Module provides uniform logging for SALT.
Class providing uniform logging.
Prints error message and backtrace to logfile.
Prints message m to logfile.
Prints warning message m to logfile.
Return the history of the call. This includes return the name of the current program as well as the information about all the parameters which are passed to it. The return is the name of the program along witha string listing all the parameters
level – the level of the frame of interest wrap – wraps characters if true wrapchar–number of characters to wrap at exclude–options to exclude
returns str, str
Context manager to ensure proper error handling and logging.
Example usage:
with logging('logfile.txt') as log:
# User code
log.message('Hello world!') # Writes a message to the log
# Some more user code
log.warning('This is a warning message') # Writes warning
# Again some user code
raise SaltError('Oops!') # Error message and traceback are written to log