firebird.lib.log

Module for parsing Firebird server log.

Enumerations

class firebird.lib.log.Severity(value)[source]

Bases: IntEnum

Firebird Log Message severity.

CRITICAL = 4
ERROR = 3
INFO = 1
UNKNOWN = 0
WARNING = 2
class firebird.lib.log.Facility(value)[source]

Bases: IntEnum

Firebird Log Server facility.

AUTH = 11
CONFIG = 2
FILEIO = 4
GUARDIAN = 9
INTL = 3
NET = 10
PLUGIN = 8
SWEEP = 7
SYSTEM = 1
UNKNOWN = 0
USER = 5
VALIDATION = 6

Dataclasses

class firebird.lib.log.LogMessage(origin: str, timestamp: datetime, level: Severity, code: int, facility: Facility, message: str, params: Dict[str, Any])[source]

Bases: object

Firebird log message.

Parameters
code: int

Message identification code

facility: Facility

Firebird server facility that wrote the message

level: Severity

Severity level

message: str

Message text. It may contain str.format {<param_name>} placeholders for message parameters.

origin: str

Firebird server identification

params: Dict[str, Any]

Dictionary with message parameters

timestamp: datetime

Date and time when message was written to log

Classes

class firebird.lib.log.LogParser[source]

Bases: object

Parser for firebird.log files.

parse(lines: Iterable)[source]

Parse output from Firebird log.

Parameters

lines (Iterable) – Iterable that returns Firebird log lines.

Yields

LogMessage instances describing individual log entries.

Raises

firebird.base.types.Error – When any problem is found in input stream.

parse_entry(log_entry: List[str]) LogMessage[source]

Parse single log entry.

Parameters

log_entry (List[str]) – List with log entry lines.

Return type

LogMessage

push(line: Union[str, Sentinel]) Optional[LogMessage][source]

Push parser.

Parameters

line (Union[str, Sentinel]) – Single line from Firebird log, or STOP sentinel.

Returns

LogMessage, or None if method did not accumulated all lines for the whole log entry.

Return type

Optional[LogMessage]