Skip to content
nightwnvol edited this page Jul 5, 2024 · 3 revisions

Logger module

Note

The dicelib package includes a logging system that allows to print messages to the console. The logging system is based on the Python logging module, which is a standard module in the Python library. The logging system is used to provide information about the execution of the code, such as the progress of the execution, the status of the execution, and any errors or warning that may occur during the execution.

Logging levels

The logging module defines several logging levels that can be used to control the verbosity of the logging system. The logging levels are defined as follows:

  • level 0: Show only the critical errors that cause the software to stop working.
  • level 1: Show the errors that cause the software to stop working and the warnings that indicate a potential problem.
  • level 2: Show the errors, warnings, and the information about the main function calls and the execution time.
  • level 3: Show the errors, warnings, information, and progress of the execution using progress bars.
  • level 4: Show the errors, warnings, information, progress of the execution, and the detailed information, typically of interest only when diagnosing problems.

Progress bars

The dicelib package includes a progress bar that can be used to display the progress of the execution of the code. The progress bar can be either "determinate" or "indeterminate".
The "determinate" progress bar shows the progress of the execution as a percentage along with the estimated time remaining as follows:

Progress bar

The "indeterminate" progress bar shows the progress of the execution as a moving bar as follows:

Progress bar