From 944d48d7ef81a42b2ca2dc49f1d8ea95e2e8f2de Mon Sep 17 00:00:00 2001 From: fpdb-mme Date: Tue, 3 Nov 2009 15:35:20 +0100 Subject: [PATCH] refactored logging setup removed fallback to '/usr/share/python-fpdb/logging.conf' if 'logging.conf' could not be found in the current directory. 1. this looked redundant, 2. usually only root has write access to /usr/share/* ok or not? --- pyfpdb/Configuration.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 33a998d3..a9fa0d93 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -36,14 +36,6 @@ 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 @@ -63,6 +55,10 @@ DATABASE_TYPES = ( DATABASE_TYPE_MYSQL, ) +# setup logging +logging.config.fileConfig(os.path.join(DIR_SELF,"logging.conf")) +log = logging.getLogger("config") + ######################################################################## def string_to_bool(string, default=True): """converts a string representation of a boolean value to boolean True or False