-
Notifications
You must be signed in to change notification settings - Fork 3
Logging
PINSPEC has the ability to print various messages to the screen while running. Using this logging capability is highly recommended, as it gives code output readability and keeps track of previous runs via a log file created as part of the output.
There are different levels of log messages, each with a particular tag: Level 0: DEBUG Level 1: INFO Level 2: NORMAL Level 3: SEPARATOR Level 4: HEADER Level 5: TITLE Level 6: WARNING Level 7: CRITICAL Level 8: RESULT Level 9: ERROR
##Setting Log Level In order to view log messages, the log level should be set near the beginning of the file, using the constructor 'py_setlevel()'. The argument of py_setlevel is the keyword for the level, given above, surrounded by single quotes.
py_print('INFO')
Selecting a specific level ensures that any logging message tagged with that keyword will be printed along with any other messages with a higher logging level. For example, the following command,
`py_print('CRITICAL')
would cause all messages tagged with the keywords CRITICAL, RESULT, and ERROR to be printed to the screen and the log file.
##Creating Logging Messages
[Return to Creating Input Files] (https://github.com/wbinventor/PINSPEC/wiki/Creating-Input-Files)