Source

lodgeit-main / lodgeit / utilities.py

from ConfigParser import ParsingError, ConfigParser
import logging
from os.path import abspath

config = ConfigParser()
if not config.read(abspath('conf/lodgeit.ini')):
    raise ParsingError("Bad parse")

FORMAT = '[%(levelname)s] %(asctime)-15s %(name)s - %(message)s'


class SQLFilter(logging.Filter):
    def filter(record):
        return 'sqlalchemy' in record.name


logging.basicConfig(format=FORMAT)
log = logging.getLogger()
log.setLevel(logging.DEBUG)