Custom Logger

Custom Logger Module.

class CustomLogger[source]

A simple Logger which has the main purpose of colorizing outputs. Barebones implementation without importing from the Logging module.

Parameters

error_log_path (str) – Path to the error log file.

pprint()[source]

Wraps the text and prints it to Stdout. In case of an error (red), logs it to CustomLogger.error_log_path

Parameters
  • text (str) – The text to print.

  • timestamp (bool) – If true, prints the timestamp before the text.

wrap()[source]

Wraps the text based on the color and returns it. Can handle a list of colors as well.

Parameters
  • text (str) – The text to wrap.

  • color (Optional[str]) – The color to wrap the text in.

Returns

The wrapped text.

Return type

str