diff options
Diffstat (limited to 'src/engine/SCons/Tool/MSCommon/common.py')
| -rw-r--r-- | src/engine/SCons/Tool/MSCommon/common.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/engine/SCons/Tool/MSCommon/common.py b/src/engine/SCons/Tool/MSCommon/common.py index 619b242..1e4aef8 100644 --- a/src/engine/SCons/Tool/MSCommon/common.py +++ b/src/engine/SCons/Tool/MSCommon/common.py @@ -34,17 +34,19 @@ import re import SCons.Util -# Uncomment to enable debug logging to your choice of file -#import logging,os -#os.unlink('c:/tmp/debug.log') -#logging.basicConfig(filename='c:/tmp/debug.log', level=logging.DEBUG,) -try: - from logging import debug -except ImportError: - debug = lambda x : None +logfile = os.environ.get('SCONS_MSCOMMON_DEBUG') +if logfile: + try: + import logging + except ImportError: + debug = lambda x: open(logfile, 'a').write(x + '\n') + else: + logging.basicConfig(filename=logfile, level=logging.DEBUG) + debug = logging.debug +else: + debug = lambda x: None -#debug = lambda x : open('con', 'w').write(x + '\n') # TODO(sgk): unused def is_win64(): |
