luminal.tools.logger

Module Contents

Classes

Logger

Logging class with a high degree of customization.

class Logger(module_name, allow_same_message=False)

Bases: object

Logging class with a high degree of customization.

Parameters:
  • module_name (__name__) –

  • allow_same_message (bool) –

class Verbosity

Encapsulates the varying degrees of logging output detail.

low: int = 0
default: int = 1
high: int = 2
debug: int = 3
_print(message)

Prints the provided message while also checking if duplicates are allowed or not.

Parameters:

message (tuple[str, str]) – A tuple containing the original message and the message to be printed to the console.

Return type:

None

Notes

The original message is used to compare the last printed message and to prevent the logger from spamming the console or whichever IO stream has been provided.

info(message, print_output=True)

Displays a non-critical information based message to the console.

Parameters:
  • message (str) – The message to log to the local system.

  • print_output (Optional[bool]) – A boolean, True for printing the message to the console, or False if not.

Return type:

None

note(message, print_output=True)

Displays a note-worthy information based message to the console.

Parameters:
  • message (str) – The message to log to the local system.

  • print_output (Optional[bool]) – A boolean, True for printing the message to the console, or False if not.

Return type:

bool

success(message, print_output=True)

Displays a success message to the console.

Parameters:
  • message (str) – The message to log to the local system.

  • print_output (Optional[bool]) – A boolean, True for printing the message to the console, or False if not.

Return type:

bool

warning(message, print_output=True)

Displays a warning message to the console.

Parameters:
  • message (str) – The message to log to the local system.

  • print_output (Optional[bool]) – A boolean, True for printing the message to the console, or False if not.

Return type:

bool

error(message, print_output=True)

Displays an error based message to the console.

Parameters:
  • message (str) – The message to log to the local system.

  • print_output (Optional[bool]) – A boolean, True for printing the message to the console, or False if not.

Return type:

bool

private(message, print_output=True)

Displays a private based message to the console.

Parameters:
  • message (str) – The message to log to the local system.

  • print_output (Optional[bool]) – A boolean, True for printing the message to the console, or False if not.

Return type:

bool

debug(message, print_output=True)

Displays a debug based message to the console.

Parameters:
  • message (str) – The message to log to the local system.

  • print_output (Optional[bool]) – A boolean, True for printing the message to the console, or False if not.

Return type:

bool