Clean up logging changes.
This commit is contained in:
parent
b637247871
commit
5021cae297
|
@ -84,13 +84,13 @@ def get_config(file_name, fallback = True):
|
||||||
sys.exit()
|
sys.exit()
|
||||||
return file_name
|
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)
|
conf = get_config(file_name, fallback = fallback)
|
||||||
if conf:
|
if conf:
|
||||||
try:
|
try:
|
||||||
logging.config.fileConfig(conf)
|
logging.config.fileConfig(conf)
|
||||||
log = logging.getLogger("config")
|
log = logging.getLogger(config)
|
||||||
log.debug("config logger initialised")
|
log.debug("%s logger initialised" % config)
|
||||||
return log
|
return log
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -102,7 +102,6 @@ def get_logger(file_name, fallback = False):
|
||||||
|
|
||||||
# find a logging.conf file and set up logging
|
# find a logging.conf file and set up logging
|
||||||
log = get_logger("logging.conf")
|
log = get_logger("logging.conf")
|
||||||
log.error("FARTS")
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# application wide consts
|
# application wide consts
|
||||||
|
|
|
@ -46,8 +46,6 @@ import Tourney
|
||||||
from Exceptions import *
|
from Exceptions import *
|
||||||
|
|
||||||
log = Configuration.get_logger("logging.conf")
|
log = Configuration.get_logger("logging.conf")
|
||||||
log.error("TURDS")
|
|
||||||
|
|
||||||
|
|
||||||
class Database:
|
class Database:
|
||||||
|
|
||||||
|
|
|
@ -32,19 +32,12 @@ from xml.dom.minidom import Node
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
from Exceptions import FpdbParseError
|
from Exceptions import FpdbParseError
|
||||||
|
import Configuration
|
||||||
|
|
||||||
import gettext
|
import gettext
|
||||||
gettext.install('fpdb')
|
gettext.install('fpdb')
|
||||||
|
|
||||||
import logging, logging.config
|
log = Configuration.get_logger("logging.conf")
|
||||||
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")
|
|
||||||
|
|
||||||
import pygtk
|
import pygtk
|
||||||
import gtk
|
import gtk
|
||||||
|
|
|
@ -42,15 +42,7 @@ import fpdb_parse_logic
|
||||||
import Configuration
|
import Configuration
|
||||||
import Exceptions
|
import Exceptions
|
||||||
|
|
||||||
import logging, logging.config
|
log = Configuration.get_logger("logging.conf", "importer")
|
||||||
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')
|
|
||||||
|
|
||||||
# database interface modules
|
# database interface modules
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user