forked from shaba/openuds
Added check debug logging with a file
This commit is contained in:
parent
9e0fbca339
commit
d51b22096e
@ -33,16 +33,21 @@ from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
import os
|
||||
import os.path
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
LOGLEVEL = logging.INFO
|
||||
|
||||
# Update debug level if uds-debug-on exists
|
||||
if 'linux' in sys.platform or 'darwin' in sys.platform:
|
||||
from os.path import expanduser # pylint: disable=ungrouped-imports
|
||||
logFile = expanduser('~/udsclient.log')
|
||||
logFile = os.path.expanduser('~/udsclient.log')
|
||||
if os.path.isfile(os.path.expanduser('~/uds-debug-on')):
|
||||
LOGLEVEL = logging.DEBUG
|
||||
else:
|
||||
logFile = os.path.join(tempfile.gettempdir(), 'udsclient.log')
|
||||
if os.path.isfile(os.path.join(tempfile.gettempdir(), 'uds-debug-on')):
|
||||
LOGLEVEL = logging.DEBUG
|
||||
|
||||
try:
|
||||
logging.basicConfig(
|
||||
|
Loading…
Reference in New Issue
Block a user