pub struct LoggingMeshClient { /* private fields */ }Expand description
LoggingMeshClient is the Python-facing handle for distributed
logging over a ProcMesh.
Calling spawn(...) builds three pieces of logging infra:
-
client_actor: a singleLogClientActorrunning in the local process. It aggregates forwarded stdout/stderr, batches it, and coordinates sync flush barriers. -
forwarder_mesh: (optional) anActorMesh<LogForwardActor>with one actor per remote proc. EachLogForwardActorsits in that proc and forwards its stdout/stderr back to the client. This mesh only exists ifMESH_ENABLE_LOG_FORWARDINGwastrueat startup; otherwise it’sNoneand we never spawn any forwarders. -
logger_mesh: anActorMesh<LoggerRuntimeActor>with one actor per remote proc. EachLoggerRuntimeActorcontrols that proc’s Python logging runtime (log level, handlers, etc.). This mesh is always created, even if forwarding is disabled.
The Python object you get back holds references to all of this so that you can:
- toggle streaming vs “stay quiet” (
set_mode(...)), - adjust the per-proc Python log level (
set_mode(...)), - force a sync flush of forwarded output and wait for completion
(
flush(...)).
Drop semantics:
Dropping the Python handle runs Drop on this Rust struct,
which drains/stops the local LogClientActor but does not
synchronously tear down the per-proc meshes. The remote
LogForwardActor / LoggerRuntimeActor instances keep running
until the remote procs themselves are shut down (e.g. via
host_mesh.shutdown(...) in tests).
Trait Implementations§
Source§impl Drop for LoggingMeshClient
impl Drop for LoggingMeshClient
Source§impl<'py> IntoPyObject<'py> for LoggingMeshClient
impl<'py> IntoPyObject<'py> for LoggingMeshClient
Source§type Target = LoggingMeshClient
type Target = LoggingMeshClient
Source§type Output = Bound<'py, <LoggingMeshClient as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <LoggingMeshClient as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for LoggingMeshClient
impl PyClass for LoggingMeshClient
Source§impl PyClassImpl for LoggingMeshClient
impl PyClassImpl for LoggingMeshClient
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// `LoggingMeshClient` is the Python-facing handle for distributed
/// logging over a `ProcMesh`.
///
/// Calling `spawn(...)` builds three pieces of logging infra:
///
/// - `client_actor`: a single `LogClientActor` running in the
/// *local* process. It aggregates forwarded stdout/stderr,
/// batches it, and coordinates sync flush barriers.
///
/// - `forwarder_mesh`: (optional) an `ActorMesh<LogForwardActor>`
/// with one actor per remote proc. Each `LogForwardActor` sits in
/// that proc and forwards its stdout/stderr back to the client.
/// This mesh only exists if `MESH_ENABLE_LOG_FORWARDING` was `true`
/// at startup; otherwise it's `None` and we never spawn any
/// forwarders.
///
/// - `logger_mesh`: an `ActorMesh<LoggerRuntimeActor>` with one
/// actor per remote proc. Each `LoggerRuntimeActor` controls that
/// proc's Python logging runtime (log level, handlers, etc.).
/// This mesh is always created, even if forwarding is disabled.
///
/// The Python object you get back holds references to all of this so
/// that you can:
/// - toggle streaming vs "stay quiet" (`set_mode(...)`),
/// - adjust the per-proc Python log level (`set_mode(...)`),
/// - force a sync flush of forwarded output and wait for completion
/// (`flush(...)`).
///
/// Drop semantics:
/// Dropping the Python handle runs `Drop` on this Rust struct,
/// which drains/stops the local `LogClientActor` but does *not*
/// synchronously tear down the per-proc meshes. The remote
/// `LogForwardActor` / `LoggerRuntimeActor` instances keep running
/// until the remote procs themselves are shut down (e.g. via
/// `host_mesh.shutdown(...)` in tests).
const RAW_DOC: &'static CStr = /// `LoggingMeshClient` is the Python-facing handle for distributed /// logging over a `ProcMesh`. /// /// Calling `spawn(...)` builds three pieces of logging infra: /// /// - `client_actor`: a single `LogClientActor` running in the /// *local* process. It aggregates forwarded stdout/stderr, /// batches it, and coordinates sync flush barriers. /// /// - `forwarder_mesh`: (optional) an `ActorMesh<LogForwardActor>` /// with one actor per remote proc. Each `LogForwardActor` sits in /// that proc and forwards its stdout/stderr back to the client. /// This mesh only exists if `MESH_ENABLE_LOG_FORWARDING` was `true` /// at startup; otherwise it's `None` and we never spawn any /// forwarders. /// /// - `logger_mesh`: an `ActorMesh<LoggerRuntimeActor>` with one /// actor per remote proc. Each `LoggerRuntimeActor` controls that /// proc's Python logging runtime (log level, handlers, etc.). /// This mesh is always created, even if forwarding is disabled. /// /// The Python object you get back holds references to all of this so /// that you can: /// - toggle streaming vs "stay quiet" (`set_mode(...)`), /// - adjust the per-proc Python log level (`set_mode(...)`), /// - force a sync flush of forwarded output and wait for completion /// (`flush(...)`). /// /// Drop semantics: /// Dropping the Python handle runs `Drop` on this Rust struct, /// which drains/stops the local `LogClientActor` but does *not* /// synchronously tear down the per-proc meshes. The remote /// `LogForwardActor` / `LoggerRuntimeActor` instances keep running /// until the remote procs themselves are shut down (e.g. via /// `host_mesh.shutdown(...)` in tests).
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<LoggingMeshClient>
type ThreadChecker = SendablePyClass<LoggingMeshClient>
type Inventory = Pyo3MethodsInventoryForLoggingMeshClient
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
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, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder LoggingMeshClient
impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder LoggingMeshClient
Source§impl PyTypeInfo for LoggingMeshClient
impl PyTypeInfo for LoggingMeshClient
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.impl DerefToPyAny for LoggingMeshClient
Auto Trait Implementations§
impl !Freeze for LoggingMeshClient
impl !RefUnwindSafe for LoggingMeshClient
impl Send for LoggingMeshClient
impl Sync for LoggingMeshClient
impl Unpin for LoggingMeshClient
impl !UnwindSafe for LoggingMeshClient
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§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>
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>
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 moreSource§impl<T> IntoPyObjectBox for Twhere
T: for<'py> IntoPyObject<'py> + Send,
impl<T> IntoPyObjectBox for Twhere
T: for<'py> IntoPyObject<'py> + Send,
fn into_py_object(self: Box<T>, py: Python<'_>) -> Result<Py<PyAny>, PyErr>
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].