Base Types¶
The plainlog._base module defines the foundational types used
throughout the library.
Type Aliases¶
| Alias | Description |
|---|---|
Msg |
Log message content — accepts any type. |
Record |
A log record — a plain Python dict. |
level |
Log level — a plain int (e.g. 10, 20, 30). The human-readable name is stored as level_name on each record. |
UniversalProcessorProtocol |
Union of ProcessorProtocol and ProcessorCloseProtocol — a processor with or without a close() method. |
API Reference¶
RecordException¶
Bases: NamedTuple
Pickle-safe exception info attached to log records.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Optional[type[BaseException]]
|
The exception class, or |
value |
Optional[BaseException]
|
The exception instance, or |
traceback |
Optional[TracebackType]
|
The traceback object, or |
ProcessorProtocol¶
Bases: Protocol
ProcessorCloseProtocol¶
Bases: ProcessorProtocol, Protocol
UniversalProcessorProtocol¶
Record Keys¶
Core keys:
levellevel_namemsgnamecreatedprocess_idprocess_nameexception
Additional keys added by plainlog features:
exc_infocaller_infofunctionlinepathmodulefile_namefile_paththread_idthread_name
Additional user-supplied fields are also stored directly on the record.