Move responsibility of log formatting to frontend application.
This commit is contained in:
parent
6b4b6040be
commit
cae90acfc6
2 changed files with 8 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
|||
import logging
|
||||
handler = logging.StreamHandler()
|
||||
log_format = '{levelname}:timesearch.{module}.{funcName}: {message}'
|
||||
handler.setFormatter(logging.Formatter(log_format, style='{'))
|
||||
logging.getLogger().addHandler(handler)
|
||||
|
||||
|
||||
import sys
|
||||
import timesearch
|
||||
|
||||
|
|
|
@ -21,12 +21,8 @@ if bot is None or bot.praw != praw:
|
|||
bot = bot4
|
||||
|
||||
|
||||
logging.basicConfig()
|
||||
log = logging.getLogger(__name__)
|
||||
log.setLevel(logging.NOTSET)
|
||||
handler = logging.StreamHandler()
|
||||
handler.setLevel(logging.NOTSET)
|
||||
handler.setFormatter(logging.Formatter('%(levelname)s:timesearch.%(module)s: %(message)s'))
|
||||
log.addHandler(handler)
|
||||
|
||||
r = bot.anonymous()
|
||||
|
||||
|
|
Loading…
Reference in a new issue