diff options
Diffstat (limited to 'ebknotify/common.py')
-rw-r--r-- | ebknotify/common.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ebknotify/common.py b/ebknotify/common.py new file mode 100644 index 0000000..0566c40 --- /dev/null +++ b/ebknotify/common.py @@ -0,0 +1,8 @@ +import logging + +def set_lol(lol,log): + numeric_level = getattr(logging,lol.upper(),None) + if not isinstance(numeric_level,int): + raise AttributeError('No such log level {}'.format(lol)) + logging.basicConfig(level=numeric_level) + log.setLevel(numeric_level) |