Data Classes

Predefined Data Classes

class zlogging._data.ASCIIInfo(path, open, close, data, exit_with_error)[source]

Bases: Info

Parsed log info for ASCII logs.

The ASCII log will be stored as in this dataclass, as introduced in PEP 557.

Parameters
  • path (PathLike[str]) – The value is specified in the ASCII log file under # path directive.

  • open (DateTimeType) – The value is specified in the ASCII log file under # open directive.

  • close (DateTimeType) – The value is specified in the ASCII log file under # close directive.

  • data (list[Model]) – The log records parsed as a list of Model per line.

  • exit_with_error (bool) – When exit with error, the ASCII log file doesn’t has a # close directive.

property format: Literal['ascii']

Log file format.

Return type

Literal[‘ascii’]

path: PathLike[str]

Log path. The value is specified in the ASCII log file under # path directive.

open: DateTimeType

Log open time. The value is specified in the ASCII log file under # open directive.

close: DateTimeType

Log close time. The value is specified in the ASCII log file under # close directive.

data: list[Model]

Log records. The log records parsed as a list of Model per line.

exit_with_error: bool

Log exit with error. When exit with error, the ASCII log file doesn’t has a # close directive.

class zlogging._data.JSONInfo(data)[source]

Bases: Info

Parsed log info for JSON logs.

The JSON log will be stored as in this dataclass, as introduced in PEP 557.

Parameters

data (list[Model]) – The log records parsed as a list of Model per line.

property format: Literal['json']

Log file format.

Return type

Literal[‘json’]

data: list[Model]

Log records. The log records parsed as a list of Model per line.

Abstract Base Data Class

class zlogging._data.Info[source]

Bases: object

Parsed log info.

The parsed log will be stored as in this dataclass, as introduced in PEP 557.

abstract property format: str

Log file format.

Return type

str