From cbaa5cef4624645244fb1afc1cf891944a29cea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 18 May 2017 12:36:05 +0200 Subject: [PATCH] Fixed error on udsclient for Linux that was creating the log file on /tmp instead of home user folder --- client/full/src/uds/log.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/full/src/uds/log.py b/client/full/src/uds/log.py index 461f7897..41717242 100644 --- a/client/full/src/uds/log.py +++ b/client/full/src/uds/log.py @@ -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