event.handler.file

Module Contents

Classes

FileHandler

Interface to implement in order to be able to send events.

class event.handler.file.FileHandler(log_dir: str)

Bases: e3.event.EventHandler

Interface to implement in order to be able to send events.

One method needs to be implemented by a new EventManager:

  • send_event: method sending an event to an external service

send_event(event: e3.event.Event) bool

Send an event.

Parameters:

event – an Event

Returns:

True on success, False otherwise

classmethod decode_config(config_str: str) dict[str, str]

Decode a config string into a dict.

Parameters:

config_str – the string containing configuration information

Returns:

a dict that can be used as **kwargs for the handler initialization method

encode_config() str

Encode the handler configuration into a string.

This default implementation can be used for handlers that do not need any configuration parameters (i.e: for which __init__ does not take any parameter apart for self).

Returns:

a string that contains the current handler configuration. The string should not contain the ‘|’ character.