forked from shaba/openuds
Fixing up client
This commit is contained in:
parent
97841d655b
commit
4424f2a497
@ -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):
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user