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 logging
|
||||||
import os
|
import os
|
||||||
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
LOGLEVEL = logging.INFO
|
LOGLEVEL = logging.INFO
|
||||||
|
|
||||||
|
# Update debug level if uds-debug-on exists
|
||||||
if 'linux' in sys.platform or 'darwin' in sys.platform:
|
if 'linux' in sys.platform or 'darwin' in sys.platform:
|
||||||
from os.path import expanduser # pylint: disable=ungrouped-imports
|
logFile = os.path.expanduser('~/udsclient.log')
|
||||||
logFile = expanduser('~/udsclient.log')
|
if os.path.isfile(os.path.expanduser('~/uds-debug-on')):
|
||||||
|
LOGLEVEL = logging.DEBUG
|
||||||
else:
|
else:
|
||||||
logFile = os.path.join(tempfile.gettempdir(), 'udsclient.log')
|
logFile = os.path.join(tempfile.gettempdir(), 'udsclient.log')
|
||||||
|
if os.path.isfile(os.path.join(tempfile.gettempdir(), 'uds-debug-on')):
|
||||||
|
LOGLEVEL = logging.DEBUG
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user