1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Fixed error on udsclient for Linux that was creating the log file on

/tmp instead of home user folder
This commit is contained in:
Adolfo Gómez García 2017-05-18 12:36:05 +02:00
parent da75dc79a7
commit cbaa5cef46

View File

@ -33,10 +33,17 @@ from __future__ import unicode_literals
import logging
import os
import sys
import tempfile
if sys.platform.startswith('linux'):
from os.path import expanduser
logFile = expanduser('~/udsclient.log')
else:
logFile = os.path.join(tempfile.gettempdir(), b'udsclient.log')
logging.basicConfig(
filename=os.path.join(tempfile.gettempdir(), b'udsclient.log'),
filename=logFile,
filemode='a',
format='%(levelname)s %(asctime)s %(message)s',
level=logging.DEBUG