pytrnsys_process.log package#

Submodules#

pytrnsys_process.log.logger module#

Configures logging for the pytrnsys_process package with three outputs: 1. Console output (INFO level) - Shows basic messages without stacktrace 2. Regular log file (INFO level) - Logs to pytrnsys_process.log without stacktrace 3. Debug log file (DEBUG level) - Logs to pytrnsys_process_debug.log with full stacktrace

The logging setup includes custom formatting for each handler and uses a TracebackInfoFilter to control stacktrace visibility in different outputs. The main logger is configured at DEBUG level to capture all logging events, while individual handlers control what gets displayed in each output.

All handlers use the same log record. Once the log record is modified and anything removed from it, will not be available in the other handlers.

pytrnsys_process.log.logger.get_main_logger(path: Path) Logger[source]#
pytrnsys_process.log.logger.initialize_logs(path: Path)[source]#

Initialize log files by clearing their contents at the start of a new run.

pytrnsys_process.log.logger.get_simulation_logger(simulation_path: Path) Logger[source]#

Create a logger specific to a simulation directory.

Parameters:

simulation_path – Path to the simulation directory

Return type:

Logger instance configured to write to a log file in the simulation directory

Module contents#

pytrnsys_process.log.initialize_logs(path: Path)[source]#

Initialize log files by clearing their contents at the start of a new run.

pytrnsys_process.log.get_simulation_logger(simulation_path: Path) Logger[source]#

Create a logger specific to a simulation directory.

Parameters:

simulation_path – Path to the simulation directory

Return type:

Logger instance configured to write to a log file in the simulation directory

pytrnsys_process.log.get_main_logger(path: Path) Logger[source]#