pub struct PyTracingHandler { /* private fields */ }
Expand description
Modifies the Python logging
module to deliver its log messages using [tracing::Subscriber] events.
To achieve this goal, the following changes are made to the module:
- A new builtin function
logging.py_tracing_event
transcodeslogging.LogRecord
s totracing::Event
s. This function is not exported inlogging.__all__
, as it is not intended to be called directly. - A new class
logging.TracingHandler
provides alogging.Handler
that delivers all records topython_tracing
.
:param level typing.Optional[int]: :param logfile typing.Optional[pathlib.Path]: :param format typing.Optional[typing.Literal[‘compact’, ‘pretty’, ‘json’]]: :rtype None:
Trait Implementations§
source§impl Debug for PyTracingHandler
impl Debug for PyTracingHandler
source§impl IntoPy<Py<PyAny>> for PyTracingHandler
impl IntoPy<Py<PyAny>> for PyTracingHandler
source§impl PyClass for PyTracingHandler
impl PyClass for PyTracingHandler
source§impl PyClassImpl for PyTracingHandler
impl PyClassImpl for PyTracingHandler
source§const DOC: &'static str = "TracingHandler($self, level=None, logfile=None, format=None)\n--\n\nModifies the Python `logging` module to deliver its log messages using [tracing::Subscriber] events.\n\nTo achieve this goal, the following changes are made to the module:\n- A new builtin function `logging.py_tracing_event` transcodes `logging.LogRecord`s to `tracing::Event`s. This function\n is not exported in `logging.__all__`, as it is not intended to be called directly.\n- A new class `logging.TracingHandler` provides a `logging.Handler` that delivers all records to `python_tracing`.\n\n:param level typing.Optional\\[int\\]:\n:param logfile typing.Optional\\[pathlib.Path\\]:\n:param format typing.Optional\\[typing.Literal\\[\'compact\', \'pretty\', \'json\'\\]\\]:\n:rtype None:\u{0}"
const DOC: &'static str = "TracingHandler($self, level=None, logfile=None, format=None)\n--\n\nModifies the Python `logging` module to deliver its log messages using [tracing::Subscriber] events.\n\nTo achieve this goal, the following changes are made to the module:\n- A new builtin function `logging.py_tracing_event` transcodes `logging.LogRecord`s to `tracing::Event`s. This function\n is not exported in `logging.__all__`, as it is not intended to be called directly.\n- A new class `logging.TracingHandler` provides a `logging.Handler` that delivers all records to `python_tracing`.\n\n:param level typing.Optional\\[int\\]:\n:param logfile typing.Optional\\[pathlib.Path\\]:\n:param format typing.Optional\\[typing.Literal\\[\'compact\', \'pretty\', \'json\'\\]\\]:\n:rtype None:\u{0}"
Class doc string
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type Layout = PyCell<PyTracingHandler>
type Layout = PyCell<PyTracingHandler>
Layout
§type ThreadChecker = ThreadCheckerStub<PyTracingHandler>
type ThreadChecker = ThreadCheckerStub<PyTracingHandler>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyTracingHandler
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyTracingHandler
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PyTracingHandler
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PyTracingHandler
source§impl PyMethods<PyTracingHandler> for PyClassImplCollector<PyTracingHandler>
impl PyMethods<PyTracingHandler> for PyClassImplCollector<PyTracingHandler>
fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for PyTracingHandler
impl PyTypeInfo for PyTracingHandler
§type AsRefTarget = PyCell<PyTracingHandler>
type AsRefTarget = PyCell<PyTracingHandler>
Utility type to make Py::as_ref work.
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.Auto Trait Implementations§
impl Freeze for PyTracingHandler
impl !RefUnwindSafe for PyTracingHandler
impl Send for PyTracingHandler
impl Sync for PyTracingHandler
impl Unpin for PyTracingHandler
impl !UnwindSafe for PyTracingHandler
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.