File: log.py

package info (click to toggle)
python-eventlet 0.26.1-7%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,916 kB
  • sloc: python: 24,898; makefile: 98
file content (19 lines) | stat: -rw-r--r-- 337 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import logging

from eventlet.zipkin import api


__original_handle__ = logging.Logger.handle


def _patched_handle(self, record):
    __original_handle__(self, record)
    api.put_annotation(record.getMessage())


def patch():
    logging.Logger.handle = _patched_handle


def unpatch():
    logging.Logger.handle = __original_handle__