Commit c25bb699 authored by Sigmund Augdal's avatar Sigmund Augdal

Logging improvements:

 * Don't log to stderr when logging to file
 * Don't log all informational messages from urllib3
 * Log any unhandled exceptions to the log file
parent 2a18d29b
......@@ -34,8 +34,9 @@ def main():
conf = SafeConfigParser()
conf.read(args.config)
if args.logfile:
logging.basicConfig(level=logging.INFO)
setupLogfile(args.logfile)
logging.getLogger("").setLevel(logging.INFO)
logging.getLogger("urllib3").setLevel(logging.WARNING)
else:
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)s %(levelname)s %(message)s')
......@@ -105,4 +106,7 @@ def main():
if __name__ == '__main__':
main()
try:
main()
except Exception:
logging.exception("Unhandled exception")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment