Skip to content

Commit

Permalink
standard logger for client funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
divi255 committed Aug 21, 2019
1 parent dcf16a4 commit 76f551f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pptop/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,16 @@ def log_traceback(msg=None):

args += (traceback.format_exc(),)
log(*args)


def init_logging():

import logging

class LogHandler(logging.Handler):

def emit(self, record):
log('{} {} {} {}'.format(record.levelname, record.module,
record.funcName, record.getMessage()))

logging.getLogger().addHandler(LogHandler())

0 comments on commit 76f551f

Please sign in to comment.