3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 23:09:23 +01:00
PyLink/log.py

16 lines
361 B
Python

import logging
import sys
from conf import conf
level = conf['bot']['loglevel'].upper()
try:
level = getattr(logging, level)
except AttributeError:
print('ERROR: Invalid log level %r specified in config.' % level)
sys.exit(3)
logging.basicConfig(level=level, format='%(asctime)s [%(levelname)s] %(message)s')
global log
log = logging.getLogger()