Utilities¶
This documents general purpose utility functions available in Logbook.
-
logbook.
debug
(self, *args, **kwargs)¶ Logs a
LogRecord
with the level set toDEBUG
.
-
logbook.
info
(self, *args, **kwargs)¶ Logs a
LogRecord
with the level set toINFO
.
-
logbook.
warn
(self, *args, **kwargs)¶ Logs a
LogRecord
with the level set toWARNING
. This function has an alias namedwarning()
.
-
logbook.
notice
(self, *args, **kwargs)¶ Logs a
LogRecord
with the level set toNOTICE
.
-
logbook.
error
(self, *args, **kwargs)¶ Logs a
LogRecord
with the level set toERROR
.
-
logbook.
exception
(self, *args, **kwargs)¶ Works exactly like
error()
just that the message is optional and exception information is recorded.
-
logbook.
catch_exceptions
(self, *args, **kwargs)¶ A context manager that catches exceptions and calls
exception()
for exceptions caught that way. Example:with logger.catch_exceptions(): execute_code_that_might_fail()
-
logbook.
critical
(self, *args, **kwargs)¶ Logs a
LogRecord
with the level set toCRITICAL
.