Help & Guides¶
- Introduction to Logging in Python
- Switching from standard
logging
tologuru
- Fundamental differences between
logging
andloguru
- Replacing
getLogger()
function - Replacing
Logger
objects - Replacing
Handler
,Filter
andFormatter
objects - Replacing
%
style formatting of messages - Replacing
exc_info
argument - Replacing
extra
argument andLoggerAdapter
objects - Replacing
isEnabledFor()
method - Replacing
addLevelName()
andgetLevelName()
functions - Replacing
basicConfig()
anddictConfig()
functions - Making things work with Pytest and caplog
- Fundamental differences between
- Code snippets and recipes for
loguru
- Changing the level of an existing handler
- Sending and receiving log messages across network or processes
- Resolving
UnicodeEncodeError
and other encoding issues - Logging entry and exit of functions with a decorator
- Using logging function based on custom added levels
- Preserving an
opt()
parameter for the whole module - Serializing log messages using a custom function
- Rotating log file based on both size and time
- Dynamically formatting messages to properly align values with padding
- Customizing the formatting of exceptions
- Displaying a stacktrace without using the error context
- Manipulating newline terminator to write multiple logs on the same line
- Capturing standard
stdout
,stderr
andwarnings
- Circumventing modules whose
__name__
value is absent - Interoperability with
tqdm
iterations - Using Loguru’s
logger
within a Cython module - Creating independent loggers with separate set of handlers
- Compatibility with
multiprocessing
usingenqueue
argument