firebird.lib.logmsgs

Firebird log messages for Firebird log parser

Enums

Severity

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

Bases: IntEnum

Firebird Log Message severity.

CRITICAL = 4
ERROR = 3
INFO = 1
UNKNOWN = 0
WARNING = 2

Facility

class firebird.lib.logmsgs.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

MsgDesc

class firebird.lib.logmsgs.MsgDesc(msg_id: int, severity: Severity, facility: Facility, msg_format: List[str])[source]

Bases: object

Firebird log message descriptor.

Parameters
get_pattern(without_optional: bool) str[source]

Returns message pattern.

Parameters

without_optional (bool) – When True, the pattern does not include optional part.

Return type

str

facility: Facility

Firebird facility

msg_format: List[str]

Message format description

msg_id: int

Message ID

severity: Severity

Message severity level

Functions

identify_msg

firebird.lib.logmsgs.identify_msg(msg: str) Optional[Tuple[MsgDesc, Dict[str, Any], bool]][source]

Identify Firebird log message.

Parameters

msg (str) – Firebird log entry with message to be identified.

Returns

Tuple with matched MsgDesc instance, dictionary with extracted message parameters, and boolean flag indicating whether message has optional content. Returns None if message was not matched against any message descriptor.

Return type

Optional[Tuple[MsgDesc, Dict[str, Any], bool]]