22 lines
628 B
Python
22 lines
628 B
Python
from settings import Settings
|
|
import logging
|
|
import logging.config
|
|
import sys
|
|
|
|
from logging import handlers
|
|
|
|
class Logger:
|
|
log = None
|
|
|
|
def __init__(self, name):
|
|
config=Settings()
|
|
#logging.config.dictConfig(config.logging)
|
|
#self.logger = logging.getLogger(__name__)
|
|
self.log = logging.getLogger(name)
|
|
self.log.setLevel(logging.DEBUG)
|
|
format = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
|
ch = logging.StreamHandler(sys.stdout)
|
|
ch.setFormatter(format)
|
|
self.log.addHandler(ch)
|
|
self.log.debug('Logging configured')
|