mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
fix logging.notice/trace methods which were masking file/line/function of log message
This commit is contained in:
parent
f401b21958
commit
7fef2336e6
2
setup.py
2
setup.py
@ -52,7 +52,7 @@ except:
|
||||
|
||||
setuptools.setup(
|
||||
name='warcprox',
|
||||
version='2.3.1b4.dev135',
|
||||
version='2.3.1b4.dev136',
|
||||
description='WARC writing MITM HTTP/S proxy',
|
||||
url='https://github.com/internetarchive/warcprox',
|
||||
author='Noah Levitt',
|
||||
|
@ -95,24 +95,20 @@ class RequestBlockedByRule(Exception):
|
||||
# monkey-patch log levels TRACE and NOTICE
|
||||
TRACE = 5
|
||||
import logging
|
||||
def _logging_trace(msg, *args, **kwargs):
|
||||
logging.root.trace(msg, *args, **kwargs)
|
||||
def _logger_trace(self, msg, *args, **kwargs):
|
||||
if self.isEnabledFor(TRACE):
|
||||
self._log(TRACE, msg, args, **kwargs)
|
||||
logging.trace = _logging_trace
|
||||
logging.Logger.trace = _logger_trace
|
||||
logging.trace = logging.root.trace
|
||||
logging.addLevelName(TRACE, 'TRACE')
|
||||
|
||||
NOTICE = (logging.INFO + logging.WARN) // 2
|
||||
import logging
|
||||
def _logging_notice(msg, *args, **kwargs):
|
||||
logging.root.notice(msg, *args, **kwargs)
|
||||
def _logger_notice(self, msg, *args, **kwargs):
|
||||
if self.isEnabledFor(NOTICE):
|
||||
self._log(NOTICE, msg, args, **kwargs)
|
||||
logging.notice = _logging_notice
|
||||
logging.Logger.notice = _logger_notice
|
||||
logging.notice = logging.root.notice
|
||||
logging.addLevelName(NOTICE, 'NOTICE')
|
||||
|
||||
import warcprox.controller as controller
|
||||
|
Loading…
x
Reference in New Issue
Block a user