koi_net.infra.log_system

Classes

LogSystem([use_file_handler, ...])

Configures and initializes the logging system.

PartitionedFileHandler([log_file_name, ...])

class koi_net.infra.log_system.LogSystem(use_file_handler=True, use_console_handler=True, file_handler_log_level=10, console_handler_log_level=10)[source]

Bases: object

Configures and initializes the logging system.

Parameters:
  • use_file_handler (bool)

  • use_console_handler (bool)

  • file_handler_log_level (int)

  • console_handler_log_level (int)

configure()[source]
configure_console_handler()[source]
console_handler_log_level: int
static delete_file_handler(log_dir, wipe_logs=False)[source]
Parameters:
  • log_dir (str)

  • wipe_logs (bool)

file_handler_log_level: int
use_console_handler: bool
use_file_handler: bool
class koi_net.infra.log_system.PartitionedFileHandler(log_file_name='log.ndjson', max_log_file_size=10485760, num_log_file_backups=5, log_file_encoding='utf-8')[source]

Bases: Handler

Parameters:
  • log_file_name (str)

  • max_log_file_size (int)

  • num_log_file_backups (int)

  • log_file_encoding (str)

del_handler(log_dir, wipe_logs=False)[source]
Parameters:
  • log_dir (str)

  • wipe_logs (bool)

emit(record)[source]

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

Parameters:

record (LogRecord)

get_handler(log_dir)[source]
Parameters:

log_dir (str)

handlers: dict[str, RotatingFileHandler]