X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=python-lttngust%2Flttngust%2Floghandler.py;fp=python-lttngust%2Flttngust%2Floghandler.py;h=0000000000000000000000000000000000000000;hb=9d4c8b2d907edb9ebc9bfde55602598e7ba0832e;hp=745d96371efe344ca28d3c67b71e4cf94b214dca;hpb=6ba6fd60507f8e045bdc4f1be14e9d99c6a15f7f;p=lttng-ust.git diff --git a/python-lttngust/lttngust/loghandler.py b/python-lttngust/lttngust/loghandler.py deleted file mode 100644 index 745d9637..00000000 --- a/python-lttngust/lttngust/loghandler.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -# -# SPDX-License-Identifier: LGPL-2.1-only -# -# Copyright (C) 2015 Philippe Proulx -# Copyright (C) 2014 David Goulet - -from __future__ import unicode_literals -import logging -import ctypes - -from .version import __soname_major__ - -class _Handler(logging.Handler): - _LIB_NAME = 'liblttng-ust-python-agent.so.' + __soname_major__ - - def __init__(self): - super(self.__class__, self).__init__(level=logging.NOTSET) - self.setFormatter(logging.Formatter('%(asctime)s')) - - # will raise if library is not found: caller should catch - self.agent_lib = ctypes.cdll.LoadLibrary(_Handler._LIB_NAME) - - def emit(self, record): - self.agent_lib.py_tracepoint(self.format(record).encode(), - record.getMessage().encode(), - record.name.encode(), - record.funcName.encode(), - record.lineno, record.levelno, - record.thread, - record.threadName.encode())