mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
16 lines
361 B
Python
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()
|