SELKIELogger
1.0.0
|
Parse incoming messages. More...
Public Member Functions | |
def | __init__ (self, msglogger=None) |
Initialise message sink. More... | |
def | SourceMap (self) |
def | FormatMessage (self, msg) |
Pretty print a message. More... | |
def | Process (self, message, output="dict", allMessages=False) |
Process an incoming message. More... | |
Private Attributes | |
_sm | |
Channel Map to be filled from input data. | |
_log | |
General logging object. | |
_msglog | |
Logger for messages extracted from data. | |
Parse incoming messages.
Maintains an internal mapping of channel and source names to provide prettier output.
Expects data to be provided one message at a time to .Process(), and will return data as a dict, printable string or as an SLMessage().
Definition at line 495 of file SLMessages.py.
def SELKIELogger.SLMessages.SLMessageSink.__init__ | ( | self, | |
msglogger = None |
|||
) |
Initialise message sink.
Optionally accepts a logging object for any error, warning, or information messages encountered in the source data.
msglogger | Logger object for messages extracted from data |
Definition at line 505 of file SLMessages.py.
def SELKIELogger.SLMessages.SLMessageSink.FormatMessage | ( | self, | |
msg | |||
) |
Pretty print a message.
msg | Message object |
Definition at line 531 of file SLMessages.py.
def SELKIELogger.SLMessages.SLMessageSink.Process | ( | self, | |
message, | |||
output = "dict" , |
|||
allMessages = False |
|||
) |
Process an incoming message.
Accepts SLMessage object or bytes that can be unpacked into one.
If a valid message is decoded, internal data structures are updated to provide channel and source names for message formatting and tracking of the last timestamp seen from each source. Any data messages are returned as a string or as a dictionary.
message | Message (or bytes) to be decoded |
output | Output format for each message: String, dict, raw (SLMessage) |
allMessages | Output messages normally used internally |
Definition at line 539 of file SLMessages.py.
def SELKIELogger.SLMessages.SLMessageSink.SourceMap | ( | self | ) |
Definition at line 527 of file SLMessages.py.