CustomLogger

class VmaxBuilder.utils.custom_logging.CustomLogger(name: str, log_files_location: str | Path | None = None, print_level: int = 2, auto_parse: bool = False)[source]

Public Methods

critical(…)

debug(…)

error(…)

finished(…)

fix_non_ascii_messages_decorator(…)

Generated: validation needed.

info(…)

process_stack(…)

Generated: validation needed.

set_log_files_location(…)

Generated: validation needed.

set_print_level(…)

Generated: validation needed.

starting(…)

valid(…)

warning(…)

FINISHED_LEVEL

HIGH_DETAIL_LEVEL

LOW_DETAIL_LEVEL

STARTING_LEVEL

VALID_LEVEL

set_log_files_location(log_files_location: str, mode: str = 'w') None[source]

Generated: validation needed.

Description:

Rebind the file handler to a new directory while preserving console logging.

Parameters:
  • log_files_location (str) – New directory path for the log file.

  • mode (str) – File open mode passed to FileHandler.

static fix_non_ascii_messages_decorator(func: Callable) Callable[source]

Generated: validation needed.

Description:

Decorator that sanitises log messages to cp1252-safe strings before passing them to the wrapped logging method.

Parameters:

func (Callable) – Logging method to wrap.

Returns:

Callable – Wrapped method with message sanitisation.

process_stack(stack_: list) tuple[str, int][source]

Generated: validation needed.

Description:

Walk the call stack and return filename and line number of the first frame outside this module.

Parameters:

stack_ (list) – Frame list from inspect.stack().

Returns:

tuple[str, int] – Caller filename (basename) and line number.

Raises:

ValueError – When no caller frame outside this module is found.

set_print_level(level: int) None[source]

Generated: validation needed.

Description:

Change the console handler print level dynamically.

Parameters:

level (int) – New maximum print level to pass through to console.