Events
These models describe structured log events.
LogEventMeta identifies an event before payload delivery. It is the metadata object used by event policies.
LogEvent is the completed structured event delivered to sinks.
- enum mvx.common.logger.LogLevel(value)
LogLevel defines standard severity levels used by the logger.
The numeric values follow the conventional Python logging level scale.
- Member Type:
int
Valid values are as follows:
- DEBUG = <LogLevel.DEBUG: 10>
- INFO = <LogLevel.INFO: 20>
- WARNING = <LogLevel.WARNING: 30>
- ERROR = <LogLevel.ERROR: 40>
- CRITICAL = <LogLevel.CRITICAL: 50>
- class mvx.common.logger.LogEventMeta(event_namespace, event_name, entity_id, source_path, source_line, source_func)
Metadata used to identify and select a log event before delivery.
LogEventMeta contains the stable identity of an event: where it belongs, what event it represents, which entity it is related to, and optionally where it originated in source code.
Event policies receive this object before payload normalization and sink delivery.
- Parameters:
event_namespace (
str|None) – logical namespace of the event, or None when no namespace is associated with the event.event_name (
str) – stable event name.entity_id (
str|None) – optional identifier of the runtime or domain entity related to the event.source_path (
str|None) – optional source file path associated with the event.source_line (
int|None) – optional source line associated with the event.source_func (
str|None) – optional source function associated with the event.
- class mvx.common.logger.LogEvent(level, meta, event_outcome, timestamp, payload)
Fully prepared structured log event.
LogEvent is the object delivered to a log sink. At this point the event has already been selected for emission and its payload is expected to be log-ready.
- Parameters:
level (
int) – numeric severity level.meta (
LogEventMeta) – event metadata.event_outcome (
str|None) – optional outcome or phase of the event. For example, log_invocation uses values such as"invoke","success","failed", and"cancelled".timestamp (
float) – event timestamp.payload (
Mapping[str,Any]) – structured event payload.