Python logging made (stupidly) simple
logger.complete()
asynchronous method to await
them (#171).dict
passed to the filter
argument (#148)..pyi
stub file (#162).copy.deepcopy()
of the logger
allowing multiple independent loggers with separate set of handlers (#72).datetime
to UTC before formatting (in logs and filenames) by adding "!UTC"
at the end of the time format specifier (#128).name
as the first argument of namedtuple returned by the .level()
method.class
objects from the list of supported sinks and restrict usage of **kwargs
in .add()
to file sink only. User is in charge of instantiating sink and wrapping additional keyword arguments if needed, before passing it to the .add()
method.logger.configure()
keyword argument patch
to patcher
so it better matches the signature of logger.patch()
.multiprocessing
on Windows by entirely refactoring the internal structure of the logger
so it can be inherited by child processes along with added handlers (#108).AttributeError
while using a file sink on some distributions (like Alpine Linux) missing the os.getxattr
and os.setxattr
functions (#158, thanks @joshgordon).diagnose=True
(#144).logging.Handler
sinks with .opt(raw=True)
(#136).filter
function "by name" while receiving a log with record["name"]
equals to None
.catch=True
) occurring because of non-picklable objects (if enqueue=True
).ImportError
if a Python installation is missing the built-in distutils
module (#118).TypeError
instead of ValueError
when a logger
method is called with argument of invalid type.ValueError
if the built-in format()
and filter()
functions are respectively used as format
and filter
arguments of the add()
method. This helps the user to understand the problem, as such a mistake can quite easily occur (#177).str
(for "level"
, "file"
, "thread"
and "process"
).enqueue=True
(#174, thanks @t-mart).-s
and -S
flags causing site.USER_SITE
to be missing (#114).retention
and rotation
issues when file sink initiliazed with delay=True
(#113)."sec"
no longer recognized as a valid duration unit for file rotation
and retention
arguments.@logger.catch
when backtrace=False
."{time}"
not presents in filename) so it's based on the file creation time rather than the current time.loguru
(on Windows platform, it solely remains colorama
and win32-setctime
).logger.patch()
method which can be used to modify the record dict on-the-fly before it's being sent to the handlers.backtrace
so it only extends the stacktrace upward, the display of variables values is now controlled with the new diagnose
argument (#49).rotation
option in file sinks: it is now based on the file creation time rather than the current time, note that proper support may differ depending on your platform (#58).</>
(e.g. <yellow>message</>
).diagnose
and backtrace
options are False
.sys.tracebacklimit
variable (#77).__repr__
value to the logger
for convenient debugging (#84).<red,blue>
) for simplification.record["exception"]
attribute unpackable as a (type, value, traceback)
tuple.frame.f_globals
dict did not contain "__name__"
key and hence prevented Loguru to retrieve the module's name. From now, record["name"]
will be equal to None
in such case (#62).pickle
and hence raising exception while being passed to some multiprocessing
functions (#102).AttributeError
while formatting exceptions within a celery
task (#52).logger.catch
decorator not working with generator and coroutine functions (#75).record["path"]
case being normalized for no necessary reason (#85).enqueue=True
stopping working if exception was raised in sink although catch=True
.enable()
and disable()
being called during logging.backtrace=False
so it doesn't extend traceback upward automatically (#30).localtime()
support (#33).MMM
and MMMM
tokens (#34, thanks @nasyxx).awscli
by downgrading required colorama
dependency version (#12).logger.start()
and logger.stop()
methods in favor of logger.add()
and logger.remove()
(#3).logging.Handler
sinks (#4).parser
and refactor it into the logger.parse()
method.notifier
and its dependencies (pip install notifiers
should be used instead).