core.log module¶
Logging module.
- class core.log.Log[source]¶
Bases:
object
Logging class.
- log(log_level, message, *args, **kwargs)[source]¶
Logs a message if the current logging level includes messages at level <log_level>.
- Parameters:
log_level – the level to log the message at. If less than the current logging level, nothing will happen.
message – the message to log.
*args – Used to format the message with the
%
operator.stack – if True, logs a stack trace. If sys.excinfo contains an exception, this will be formatted and logged instead.
- push_level(level)[source]¶
Temporarily changes the logging level to <level>. Call pop_level to restore the previous level.
- core.log.debug(message, *args, **kwargs)¶
Writes a DEBUG message to the log. See
Log.log
for details.
- core.log.error(message, *args, **kwargs)¶
Writes an ERROR message to the log. See
Log.log
for details.
- core.log.get_lines()¶
Returns all logged lines.
- core.log.log(log_level, message, *args, **kwargs)¶
Logs a message if the current logging level includes messages at level <log_level>.
- Parameters:
log_level – the level to log the message at. If less than the current logging level, nothing will happen.
message – the message to log.
*args – Used to format the message with the
%
operator.stack – if True, logs a stack trace. If sys.excinfo contains an exception, this will be formatted and logged instead.
- core.log.pop_level()¶
Restores the previous logging level, if the level stack is not empty.
- core.log.pop_prefix()¶
Removes the most recently added prefix from future log messages.
- core.log.push_level(level)¶
Temporarily changes the logging level to <level>. Call pop_level to restore the previous level.
- core.log.push_prefix(prefix)¶
Adds a prefix to future log messages. Old prefixes will appear before new prefixes.
- core.log.set_level(level)¶
Sets the maximum logging level to <level>.