mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
use and configure custom logger (#1994)
* prepare to log logs * utils * discoverability * forgot
This commit is contained in:
11
python/utils.py
Normal file
11
python/utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import os
|
||||
import logging
|
||||
|
||||
# set up logging
|
||||
LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO').upper()
|
||||
logger = logging.getLogger('panda')
|
||||
logger.setLevel(LOGLEVEL)
|
||||
|
||||
handler = logging.StreamHandler()
|
||||
handler.setFormatter(logging.Formatter('%(message)s'))
|
||||
logger.addHandler(handler)
|
||||
Reference in New Issue
Block a user