summaryrefslogtreecommitdiff
path: root/src/poezio.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-08-03 19:27:25 +0200
committermathieui <mathieui@mathieui.net>2013-08-03 19:27:25 +0200
commit31c2e23c4c3e2933952d5851bd5c97eb336258dd (patch)
treecb0ea7fe4d749c8a47e0457b42bbf9353fa24926 /src/poezio.py
parentc2f6ece39db14ba87ad33d6a7103193cf2e64050 (diff)
downloadpoezio-31c2e23c4c3e2933952d5851bd5c97eb336258dd.tar.gz
poezio-31c2e23c4c3e2933952d5851bd5c97eb336258dd.tar.bz2
poezio-31c2e23c4c3e2933952d5851bd5c97eb336258dd.tar.xz
poezio-31c2e23c4c3e2933952d5851bd5c97eb336258dd.zip
Logs errors by default, in a dedicated file
- log_errors option, true by default - errors go in log_dir/errors.log (so $XDG_DATA_HOME/errors.log by default) This should help a lot for debugging, and provide a way for people to easily give debug traces without useless or personal infos.
Diffstat (limited to 'src/poezio.py')
-rw-r--r--src/poezio.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/poezio.py b/src/poezio.py
index c0863416..43dd6b95 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -14,24 +14,22 @@ import sys
import os
import signal
-import logging
+import logging.config
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
-from logger import logger
from config import options
+from logger import logger
import singleton
import core
+log = logging.getLogger('')
+
def main():
"""
Enter point
"""
signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl-c
- if options.debug:
- logging.basicConfig(filename=options.debug, level=logging.DEBUG)
- else:
- logging.basicConfig(level=logging.CRITICAL)
cocore = singleton.Singleton(core.Core)
signal.signal(signal.SIGUSR1, cocore.sigusr_handler) # reload the config
signal.signal(signal.SIGHUP, cocore.exit_from_signal)
@@ -48,6 +46,7 @@ def main():
print("Poezio could not start, maybe you tried aborting it while it was starting?\n"
"If you think it is abnormal, please run it with the -d option and report the bug.")
else:
+ log.error('------------------------ new poezio start ------------------------')
cocore.main_loop() # Refresh the screen, wait for user events etc
if __name__ == '__main__':