ButlerLogRecord#
- class lsst.daf.butler.logging.ButlerLogRecord(*, name: str, asctime: datetime, message: str, levelno: int, levelname: str, filename: str, pathname: str, lineno: int, funcName: str | None = None, process: int, processName: str, exc_info: str | None = None, MDC: dict[str, str])#
Bases:
BaseModelA model representing a
logging.LogRecord.A
LogRecordalways uses the current time in its record when recreated and that makes it impossible to use it as a serialization format. Instead have a local representation of aLogRecordthat matches Butler needs.Attributes Summary
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].Methods Summary
format([log_format])Format this record.
from_record(record)Create a new instance from a
LogRecord.Attributes Documentation
- model_config: ClassVar[ConfigDict] = {'frozen': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
Methods Documentation
- format(log_format: str | None = None) str#
Format this record.
Parameters#
- log_format
str, optional The format string to use. This string follows the standard f-style use for formatting log messages. If
Nonethe class default will be used.
Returns#
- text
str The formatted log message.
- log_format
- classmethod from_record(record: LogRecord) ButlerLogRecord#
Create a new instance from a
LogRecord.Parameters#
- record
logging.LogRecord The record from which to extract the relevant information.
- record