Logger

class energyplus_refactor_helper.logger.Logger(log_file: Path | None = None, mute_stdout: bool = False)

The Logger class represents a simple class for logging output to standard out and/or an output file.

Parameters:
  • log_file – An optional path to a log file to report messages

  • mute_stdout – A True/False flag for whether to mute standard output or not, by default std out is on.

log(message: str) None

Emit a message to the log locations, such as standard output or the specified log file.

Parameters:

message – The message to emit, which is formatted along with a timestamp

Returns:

None

static terminal_progress_bar(current_num: int, total_num: int, suffix: str) None

A static log function that can be called to specifically emit a progress indicator to standard output. Note that this function intentionally does not write a new line character so that the progress bar can show up dynamically on the terminal. Once the progress is complete, either call terminal_progress_done, or print an empty string to the terminal before sending more messages.

Parameters:
  • current_num – The current progress count

  • total_num – The maximum progress count

  • suffix – A string suffix to show after the progress bar

Returns:

None

static terminal_progress_done() None

A static log function that nicely finishes a progress bar that was created/updated using the terminal_progress_bar function. This function will set the progress bar to 100% :return: None