You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
885 B
32 lines
885 B
import logging
|
|
|
|
# Bootstrap logging using a hardcoded configuration
|
|
def bootstrap_logging():
|
|
global logger
|
|
|
|
logging.basicConfig(
|
|
level=logging.NOTSET,
|
|
format='%(asctime)s %(name)s [%(levelname)-8s]: %(message)s',
|
|
datefmt='%a, %d %b %Y, %H:%M:%S')
|
|
|
|
logger = logging.getLogger('zasd')
|
|
logger.setLevel(logging.NOTSET)
|
|
|
|
logging.getLogger('apscheduler').setLevel(logging.NOTSET)
|
|
|
|
# Configure logging using a loaded configuration
|
|
def configure_logging(config):
|
|
global logger
|
|
|
|
level = config['log_level']
|
|
|
|
logging.basicConfig(
|
|
format=config['log_format'],
|
|
datefmt=config['log_date_format'])
|
|
|
|
logger = logging.getLogger('zasd')
|
|
logger.setLevel(level)
|
|
logging.getLogger('asyncio').setLevel(logging.WARN)
|
|
logging.getLogger('apscheduler').setLevel(logging.WARN)
|
|
|
|
bootstrap_logging()
|
|
|