Crate syslog_loose

Source

Structs§

Message
StructuredElement

Enums§

ProcId
Protocol
SyslogFacility
Syslog facilities. Taken From RFC 5424, but I’ve heard that some platforms mix these around. Names are from Linux.
SyslogSeverity
Syslog Severities from RFC 5424.
Variant
Used to specify which variant of the RFC message we are expecting.

Functions§

decompose_pri
The pri field is composed of both the facility and severity values. The first byte is the Severity, the remaining are the Facility.
parse_message
Parses the message. For messages where the timestamp doesn’t specify a year it just takes the current year.
parse_message_with_year
Parse the message.
parse_message_with_year_exact
Parse the message exactly. If it can’t be parsed, an Error is returned. Note, since it is hard to locate exactly what is causing the error due to the parser trying so many different combinations, a simple hardcoded string is returned as the error message.
parse_message_with_year_exact_tz
Parse the message exactly. If it can’t be parsed, an Error is returned. Note, since it is hard to locate exactly what is causing the error due to the parser trying so many different combinations, a simple hardcoded string is returned as the error message.
parse_message_with_year_tz
Parse the message.

Type Aliases§

IncompleteDate
An incomplete date is a tuple of (month, date, hour, minutes, seconds)