firebird.lib.logmsgs¶
Firebird log messages for Firebird log parser
Enums¶
Severity¶
Facility¶
Dataclasses¶
MsgDesc¶
- class firebird.lib.logmsgs.MsgDesc(msg_id: int, severity: Severity, facility: Facility, msg_format: list[str])[source]¶
Bases:
objectDescribes the structure and metadata of a known Firebird log message type.
- get_pattern(*, without_optional: bool) str[source]¶
Returns a
str.format()-style pattern for the message.- Parameters:
without_optional (bool) – If True, the returned pattern excludes any parts following an ‘OPTIONAL’ marker in
msg_format.- Returns:
A string pattern like “Operating system call {syscall} failed. Error code {error_code}”.
- Return type:
Functions¶
identify_msg¶
- firebird.lib.logmsgs.identify_msg(msg: str) tuple[MsgDesc, dict[str, Any], bool] | None[source]¶
Attempts to identify a log message string against known message descriptors.
- Parameters:
msg (str) – The textual content of a Firebird log entry (excluding timestamp/origin).
- Returns:
The matched
MsgDescinstance.A dictionary mapping parameter names (from placeholders like
{s:name}) to their extracted values (as strings or integers).A boolean flag:
Trueif the optional part of the message format (following ‘OPTIONAL’) was not present in the inputmsg,Falseotherwise.
Returns
Noneif themsgdoes not match any knownMsgDescpattern.- Return type:
A tuple containing