Skip to content

Commit

Permalink
better logging practice
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Jan 30, 2019
1 parent 968adc3 commit 2d8e8ab
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ahk/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import os
import logging


def make_logger(name):
logger = logging.getLogger(name)
handler = logging.NullHandler()
formatter = logging.Formatter(
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
if os.environ.get('AHK_DEBUG'):
logger.setLevel(logging.DEBUG)
else:
logger.setLevel(logging.ERROR)
return logger

0 comments on commit 2d8e8ab

Please sign in to comment.