Logging (structsolve.logger)#
Logging functions used by the solvers
The messages are printed to the standard output, indented with one tab per
level, and returned, such that the solvers can keep them. Every function has
a silent flag that suppresses the printing.
- structsolve.logger.error(msg, level=0, silent=False)#
Print an error message, starting with
ERROR:The prefix
ERROR: `` is added to ``msg, and the result is printed afterleveltabs unlesssilentisTrue. No exception is raised.- Parameters:
- msgstr
The message.
- levelint, optional
Indentation level, each level adds a tab. Default
0.- silentbool, optional
If
Truethe message is not printed. DefaultFalse.
- Returns:
- msgstr
The message with its prefix, without the indentation.
- structsolve.logger.msg(msg, level=0, silent=False)#
Print a log message
msgis printed afterleveltabs unlesssilentisTrue.- Parameters:
- msgstr
The message.
- levelint, optional
Indentation level, each level adds a tab. Default
0.- silentbool, optional
If
Truethe message is not printed. DefaultFalse.
- Returns:
- msgstr
The message.
- structsolve.logger.warn(msg, level=0, silent=False)#
Print a warning message, starting with
WARNING:The prefix
WARNING: `` is added to ``msg, and the result is printed afterleveltabs unlesssilentisTrue.- Parameters:
- msgstr
The message.
- levelint, optional
Indentation level, each level adds a tab. Default
0.- silentbool, optional
If
Truethe message is not printed. DefaultFalse.
- Returns:
- msgstr
The message with its prefix, without the indentation.