Added 'helldon' to transparently port the thing to the desktop :P
[jamaendo] / jamaui / __init__.py
index 7e847ff..819b0d7 100644 (file)
@@ -26,6 +26,17 @@ import logging
 import sys
 
 LOG_FILENAME = '/tmp/jamaendo.log'
-LOG_LEVEL = logging.INFO
+LOG_LEVEL = logging.DEBUG
+LOG_FORMAT = "%(asctime)s %(name)-10s: [%(lineno)4d] %(levelname)-5s %(message)s"
+
+_rootlogger = logging.getLogger()
+_fhandler = logging.FileHandler(LOG_FILENAME)
+_shandler = logging.StreamHandler()
+_formatter = logging.Formatter(LOG_FORMAT)
+_fhandler.setFormatter(_formatter)
+_shandler.setFormatter(_formatter)
+
+_rootlogger.addHandler(_fhandler)
+_rootlogger.addHandler(_shandler)
+_rootlogger.setLevel(LOG_LEVEL)
 
-logging.basicConfig(filename=LOG_FILENAME,level=LOG_LEVEL, format="%(name)-15s: [%(lineno)4d] %(levelname)-8s %(message)s")