Clean up logging changes.

This commit is contained in:
Eratosthenes 2009-11-09 19:30:23 -05:00
parent b637247871
commit 5021cae297
4 changed files with 6 additions and 24 deletions

View File

@ -84,13 +84,13 @@ def get_config(file_name, fallback = True):
sys.exit()
return file_name
def get_logger(file_name, fallback = False):
def get_logger(file_name, config = "config", fallback = False):
conf = get_config(file_name, fallback = fallback)
if conf:
try:
logging.config.fileConfig(conf)
log = logging.getLogger("config")
log.debug("config logger initialised")
log = logging.getLogger(config)
log.debug("%s logger initialised" % config)
return log
except:
pass
@ -102,7 +102,6 @@ def get_logger(file_name, fallback = False):
# find a logging.conf file and set up logging
log = get_logger("logging.conf")
log.error("FARTS")
########################################################################
# application wide consts

View File

@ -46,8 +46,6 @@ import Tourney
from Exceptions import *
log = Configuration.get_logger("logging.conf")
log.error("TURDS")
class Database:

View File

@ -32,19 +32,12 @@ from xml.dom.minidom import Node
import time
import datetime
from Exceptions import FpdbParseError
import Configuration
import gettext
gettext.install('fpdb')
import logging, logging.config
import ConfigParser
try:
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("parser")
log = Configuration.get_logger("logging.conf")
import pygtk
import gtk

View File

@ -42,15 +42,7 @@ import fpdb_parse_logic
import Configuration
import Exceptions
import logging, logging.config
import ConfigParser
try:
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('importer')
log = Configuration.get_logger("logging.conf", "importer")
# database interface modules
try: