EventEmitter
Lightweight event emitter supporting synchronous and asynchronous handlers. Handlers are registered against events and invoked when the corresponding event is emitted. Coroutine handlers are scheduled on the running event loop, or run to completion if no loop is active. Exceptions raised by handlers are logged and do not propagate to the caller. The emitter is generic over the event key typeT; event keys are coerced
to strings internally.
Constructor
emit
The event to emit.
off
The event the handler was registered for.
The handler to remove.
on
callback is omitted.
The event to listen for.
The handler to invoke when the event is emitted. If
None, a decorator is returned that registers the decorated function.The registered callback when
callback is provided, otherwise a decorator that registers and returns the function it wraps.MetricsOptions
Fields
TracesOptions
Fields
LoggingOptions
Fields
ObservabilityOptions
Fields
setup_logging
zrt.agents logger with a colorized console handler.
Replaces any existing handlers on the zrt.agents logger with a single
stream handler writing to standard output. Colorized output is enabled when
the output stream supports it. Propagation to ancestor loggers is disabled.
Logging level to apply to the logger. Defaults to
logging.INFO.returns
The configured
zrt.agents logging.Logger instance.