diff --git a/client-py3/full/src/UDSClient.py b/client-py3/full/src/UDSClient.py index c68fbf76..ae8136d8 100755 --- a/client-py3/full/src/UDSClient.py +++ b/client-py3/full/src/UDSClient.py @@ -47,7 +47,7 @@ from uds.rest import RestApi, RetryException, InvalidVersion, UDSException from uds.forward import forward # type: ignore from uds.tunnel import forward as f2 # type: ignore -from uds.log import logger +from uds.log import logger, DEBUG from uds import tools from uds import VERSION @@ -174,7 +174,8 @@ class UDSClient(QtWidgets.QMainWindow): # Retry operation in ten seconds QtCore.QTimer.singleShot(10000, self.getTransportData) except Exception as e: - # logger.exception('Got exception on getTransportData') + if DEBUG: + logger.exception('Got exception on getTransportData') self.showError(e) def start(self): diff --git a/client-py3/full/src/uds/log.py b/client-py3/full/src/uds/log.py index 1416b51b..f076550f 100644 --- a/client-py3/full/src/uds/log.py +++ b/client-py3/full/src/uds/log.py @@ -38,16 +38,19 @@ import sys import tempfile LOGLEVEL = logging.INFO +DEBUG = False # Update debug level if uds-debug-on exists if 'linux' in sys.platform or 'darwin' in sys.platform: logFile = os.path.expanduser('~/udsclient.log') if os.path.isfile(os.path.expanduser('~/uds-debug-on')): LOGLEVEL = logging.DEBUG + DEBUG = True else: logFile = os.path.join(tempfile.gettempdir(), 'udsclient.log') if os.path.isfile(os.path.join(tempfile.gettempdir(), 'uds-debug-on')): LOGLEVEL = logging.DEBUG + DEBUG = True try: logging.basicConfig(