Log
gradysim.simulator.log
Logging is an important part of any software. It helps users and developers understand what is happening during the execution of the program. When running GrADyS-SIM NextGen in prototype-mode logging is automatically configured for you.
The logger annotates the output with timing information and execution context to improve understanding.
SimulationFormatter
Bases: Formatter
Custom logging formatter responsible for annotating the simulation logs with useful information about timing and execution context.
Source code in gradysim/simulator/log.py
setup_simulation_formatter(debug, log_file)
Sets up the logger for the simulation. Called before the simulation starts to configure the logger.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
debug |
bool
|
Include DEBUG level logs |
required |
log_file |
Optional[Path]
|
Configure a logging handler to save logs in a file. Optional. |
required |
Returns:
Type | Description |
---|---|
SimulationFormatter
|
The formatter instance. Is returned because it needs to be updated with current simulation information. |