diff options
author | Tomas Touceda <chiiph@leap.se> | 2013-04-25 13:20:01 -0300 |
---|---|---|
committer | Tomas Touceda <chiiph@leap.se> | 2013-05-07 14:02:12 -0300 |
commit | 4ed3e03aa4012905d04d62c1d34e3440f8e0dacc (patch) | |
tree | 92b0e1838d74d1893f6a0c0d0f5daf0510e2a7af /start_mx.py | |
parent | dd165dcbab7e686a238655fc68a5d7d472ee1736 (diff) |
Add logfile capabilities
Diffstat (limited to 'start_mx.py')
-rwxr-xr-x | start_mx.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/start_mx.py b/start_mx.py index 7e154da..bf3dddb 100755 --- a/start_mx.py +++ b/start_mx.py @@ -55,6 +55,7 @@ if __name__ == "__main__": debug = opts.debug config_file = opts.config + logfile = opts.log_file if debug: level = logging.DEBUG @@ -73,6 +74,13 @@ if __name__ == "__main__": console.setFormatter(formatter) logger.addHandler(console) + if logfile is not None: + logger.debug('Setting logfile to %s ', logfile) + fileh = logging.FileHandler(logfile) + fileh.setLevel(logging.DEBUG) + fileh.setFormatter(formatter) + logger.addHandler(fileh) + logger.info("~~~~~~~~~~~~~~~~~~~") logger.info(" LEAP MX") logger.info("~~~~~~~~~~~~~~~~~~~") |