FileHandlers Module

This module contains classes and functions related to file handlers in the EventManager.

class EventManager.filehandlers.LogHandler(config_path: str)[source]

Bases: object

The LogHandler class is responsible for managing the logging configuration and log files.

property config: Config
property current_file_name: str
property current_internal_file_name: str
property internal_event_manager
check_if_log_file_needs_rotation()[source]
rotate_log_file(file: Path)[source]

Rotate the log file by renaming it with a timestamp.

Parameters:

file – The log file to rotate.

check_if_log_file_exists()[source]

Check if the log file exists.

Returns:

True if the log file exists, False otherwise.

check_if_internal_log_file_exists() bool[source]

Check if the internal log file exists.

Returns:

True if the internal log file exists, False otherwise.

create_log_file()[source]

Creates a new log file with the specified file name and file extension.

create_internal_log_file()[source]

Creates a new internal log file with the specified file name and file extension.

EventManager.filehandlers.default_processors() list[EventManager.filehandlers.config.processor_entry.ProcessorEntry][source]

Create a list of default processors for the EventManager. :return: A list containing a single ProcessorEntry instance.

EventManager.filehandlers.default_outputs() list[EventManager.filehandlers.config.output_entry.OutputEntry][source]

Create a list of default outputs for the EventManager. :return: A list containing a single OutputEntry instance.

class EventManager.filehandlers.ProcessorEntry(name: str = '', parameters: dict[str, object] = None)[source]

Bases: object

The ProcessorEntry class represents a configuration entry for an event processor.

property name: str
property parameters: dict[str, object]
class EventManager.filehandlers.OutputEntry(name: str = '', parameters: dict[str, object] = None)[source]

Bases: object

The OutputEntry class represents an output entry in the configuration.

property name: str
property parameters: dict[str, object]