From 31c2e23c4c3e2933952d5851bd5c97eb336258dd Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 3 Aug 2013 19:27:25 +0200 Subject: 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. --- src/poezio.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/poezio.py') 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__': -- cgit v1.2.3