From c60dfda64ccc8c350c15e3eb8d0ee1c19d9b2e2c Mon Sep 17 00:00:00 2001 From: fpdb-mme Date: Wed, 4 Nov 2009 18:58:01 +0100 Subject: [PATCH] put in former logging setup again, removed excepthook --- pyfpdb/Configuration.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index cdbc5f8f..4bf5cccb 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -36,6 +36,14 @@ from xml.dom.minidom import Node import logging, logging.config import ConfigParser + +try: # local path + logging.config.fileConfig(os.path.join(sys.path[0],"logging.conf")) +except ConfigParser.NoSectionError: # debian package path + logging.config.fileConfig('/usr/share/python-fpdb/logging.conf') + +log = logging.getLogger("config") +log.debug("config logger initialised") ######################################################################## # application wide consts @@ -55,18 +63,6 @@ DATABASE_TYPES = ( DATABASE_TYPE_MYSQL, ) -# setup logging -logging.config.fileConfig(os.path.join(DIR_SELF,"logging.conf")) -log = logging.getLogger("config") - -# setup application wide exception handler -def excepthook(Type, value, tb): - p = traceback.format_exception(type, value, tb) - log.critical(p) - raise Type(value) - -sys.excepthook = excepthook - ######################################################################## def string_to_bool(string, default=True): """converts a string representation of a boolean value to boolean True or False