Merge "py3: proxy some logger properties in LogAdapter"
This commit is contained in:
commit
1d4249ee9d
@ -1918,6 +1918,37 @@ class LogAdapter(logging.LoggerAdapter, object):
|
||||
self.server = server
|
||||
self.warn = self.warning
|
||||
|
||||
# There are a few properties needed for py35; see
|
||||
# - https://bugs.python.org/issue31457
|
||||
# - https://github.com/python/cpython/commit/1bbd482
|
||||
# - https://github.com/python/cpython/commit/0b6a118
|
||||
# - https://github.com/python/cpython/commit/ce9e625
|
||||
def _log(self, level, msg, args, exc_info=None, extra=None,
|
||||
stack_info=False):
|
||||
"""
|
||||
Low-level log implementation, proxied to allow nested logger adapters.
|
||||
"""
|
||||
return self.logger._log(
|
||||
level,
|
||||
msg,
|
||||
args,
|
||||
exc_info=exc_info,
|
||||
extra=extra,
|
||||
stack_info=stack_info,
|
||||
)
|
||||
|
||||
@property
|
||||
def manager(self):
|
||||
return self.logger.manager
|
||||
|
||||
@manager.setter
|
||||
def manager(self, value):
|
||||
self.logger.manager = value
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.logger.name
|
||||
|
||||
@property
|
||||
def txn_id(self):
|
||||
if hasattr(self._cls_thread_local, 'txn_id'):
|
||||
|
Loading…
Reference in New Issue
Block a user