Log

spirit.log.GetOutputConsoleLevel(p_state)

Returns the level up to which the Log is output to the console.

The return value will be one of the integers defined above.

spirit.log.GetOutputFileLevel(p_state)

Returns the level up to which the Log is output to a file.

The return value will be one of the integers defined above.

spirit.log.GetOutputToConsole(p_state)

Returns a bool indicating whether the Log is output to the console.

spirit.log.GetOutputToFile(p_state)

Returns a bool indicating whether the Log is output to a file.

spirit.log.append(p_state)

Force the appending of new messages to the log file.

spirit.log.get_n_entries(p_state)

Returns the number of Log entries.

spirit.log.get_n_errors(p_state)

Returns the number of error messages that have been logged.

spirit.log.get_n_warnings(p_state)

Returns the number of warning messages that have been logged.

spirit.log.send(p_state, level, sender, message, idx_image=-1, idx_chain=-1)

Add a message to the log.

  • level: see integers defined above. The message may be printed to the console and/or written to the log file, depending on the current log parameters
  • sender: see integers defined above. Used to distinguish context
  • message: a string which to log
  • idx_image: can be used to specify to which image the message relates (default: active image)
spirit.log.set_outputToFile(p_state, output, level)

Set whether the Log is output to a file and the level up to which messages are logged.

spirit.log.set_output_file_tag(p_state, tag)

Set the tagging string which is placed in front of the log file.

If “<time>” is used for the tag, it will be the time of creation of the state.

spirit.log.set_output_folder(p_state, tag)

Set the output folder in which to place the log file.

spirit.log.set_output_to_console(p_state, output, level)

Set whether the Log is output to the console and the level up to which messages are logged.