|
A monte carlo pin cell spectral code for nuclear engineering applications.
|
Utility functions for writing log messages to the screen. More...
Functions | |
| def | py_printf |
| Function to print a log message to the screen. More... | |
| def | py_set_log_level |
| Assigns the lowest level logging message. More... | |
Utility functions for writing log messages to the screen.
This module includes a set of wrapper functions for the logging routines provided by PINSPEC's C++ source code. These Python methods provide an interface for creating formatted log messages using level-based loggin and to print them to the screen as well as a logfile.
| def pinspec.log.py_printf | ( | level, | |
| my_str, | |||
| args | |||
| ) |
Function to print a log message to the screen.
This method is a wrapper to the log_printf C++ routine. It allows for formatted messages to be printed to the screen in a similar fashion to the C/C++ printf method, but with additional formatting provided by the PINSPEC logging utilities. An example of how this might be used in a PINSPEC Python script is as follows:
| level | the logging level for this message |
| my_str | the string to print to the screen |
| *args | a variable length list of values for the message string |
| def pinspec.log.py_set_log_level | ( | level | ) |
Assigns the lowest level logging message.
Sets the lowest level logging message to print to the screen. This controls the lowest level for both logging messages in the C++ source code as well as the user's PINSPEC Python input file. This function would be called at the beginning of the input file as follows:
| level | the minimum logging level ('DEBUG', 'INFO', etc) |