def _emit(self, record):
# If there's no exception being processed,
# exc_info may be a 3-tuple of None
# http://docs.python.org/library/sys.html#sys.exc_info
if record.exc_info is True or (record.exc_info and all(record.exc_info)):
handler = self.client.get_handler('elasticapm.events.Exception')
exception = handler.capture(self.client, exc_info=record.exc_info)
else:
exception = None
return self.client.capture_message(
param_message={
'message': record.msg,
'params': record.args
},
exception=exception,
level=LOOKBOOK_LEVELS[record.level],
logger_name=record.channel,
custom=record.extra,
)
评论列表
文章目录