lbry-sdk/lbrynet/analytics/logging_handler.py
2016-12-30 15:09:34 -06:00

11 lines
330 B
Python

import logging
class Handler(logging.Handler):
"""A logging handler that reports errors to the analytics manager"""
def __init__(self, manager, level=logging.ERROR):
self.manager = manager
logging.Handler.__init__(self, level)
def emit(self, record):
self.manager.send_error(record.message)