Add debug logging
This commit is contained in:
parent
500d91a14c
commit
a24e4aa18a
3 changed files with 108 additions and 12 deletions
17
info.txt
17
info.txt
|
|
@ -20,3 +20,20 @@ import logging
|
|||
logger = logging.getLogger('websockets')
|
||||
logger.setLevel(logging.INFO)
|
||||
logger.addHandler(logging.StreamHandler())
|
||||
|
||||
Output format: See https://docs.python.org/3/library/logging.html#formatter-objects
|
||||
|
||||
Example formatting:
|
||||
|
||||
FORMAT = "{asctime} [{levelname:<7}] <{name}> {funcName}(): {message}"
|
||||
DATE_FORMAT = "%F %T"
|
||||
handler = logging.StreamHandler()
|
||||
handler.setFormatter(logging.Formatter(
|
||||
fmt=FORMAT,
|
||||
datefmt=DATE_FORMAT,
|
||||
style="{"
|
||||
))
|
||||
|
||||
logger = logging.getLogger('yaboli')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logger.addHandler(handler)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue