Releases: Delgan/loguru
Releases · Delgan/loguru
0.7.3
- Fix Cython incompatibility caused by the absence of underlying stack frames, which resulted in a
ValueErrorduring logging (#88). - Fix possible
RuntimeErrorwhen removing all handlers withlogger.remove()due to thread-safety issue (#1183, thanks @jeremyk). - Fix
diagnose=Trueoption of exception formatting not working as expected with Python 3.13 (#1235, thanks @etianen). - Fix non-standard level names not fully compatible with
logging.Formatter()(#1231, thanks @yechielb2000). - Fix inability to display a literal
"\"immediately before color markups (#988). - Fix possible infinite recursion when an exception is raised from a
__repr__method decorated withlogger.catch()(#1044). - Improve performance of
datetimeformatting while logging messages (#1201, thanks @trim21). - Reduce startup time in the presence of installed but unused
IPythonthird-party library (#1001, thanks @zakstucke).
0.7.2
0.7.1
- Add a new
contextoptional argument tologger.add()specifyingmultiprocessingcontext (like"spawn"or"fork") to be used internally instead of the default one (#851). - Add support for true colors on Windows using ANSI/VT console when available (#934, thanks @tunaflsh).
- Fix possible deadlock when calling
logger.complete()with concurrent logging of an asynchronous sink (#906). - Fix file possibly rotating too early or too late when re-starting an application around midnight (#894).
- Fix inverted
"<hide>"and"<strike>"color tags (#943, thanks @tunaflsh). - Fix possible untraceable errors raised when logging non-unpicklable
Exceptioninstances while usingenqueue=True(#329). - Fix possible errors raised when logging non-picklable
Exceptioninstances while usingenqueue=True(#342, thanks @ncoudene). - Fix missing seconds and microseconds when formatting timezone offset that requires such accuracy (#961).
- Raise
ValueErrorif an attempt to use nanosecond precision for time formatting is detected (#855).
0.7.0
- Update
InterceptHandlerrecipe to make it compatible with Python 3.11 (#654). - Add a new
watchoptional argument to file sinks in order to automatically re-create possibly deleted or changed file (#471). - Make
patch()calls cumulative instead of overriding the possibly existing patching function (#462). - Make sinks added with
enqueue=Trueandcatch=Falsestill process logged messages in case of internal exception (#833). - Avoid possible deadlocks caused by re-using the logger inside a sink, a signal handler or a
__del__method. Since the logger is not re-entrant, such misuse will be detected and will now generate aRuntimeError(#712, thanks @jacksmith15). - Fix file sink rotation using an aware
datetime.timefor which the timezone was ignored (#697). - Fix logs colorization not automatically enabled for Jupyter Notebook and Google Colab (#494).
- Fix logs colorization not automatically enabled for Github Actions and others CI platforms (#604).
- Fix
logger.complete()possibly hanging forever whenenqueue=Trueandcatch=Falseif internal thread killed due toExceptionraised by sink (#647). - Fix incompatibility with
freezegunlibrary used to simulate time (#600). - Raise exception if
logger.catch()is used to wrap a class instead of a function to avoid unexpected behavior (#623).
0.6.0
- Remove internal use of
pickle.loads()considered as a security vulnerability referenced as CVE-2022-0329 (#563). - Modify coroutine sink to make it discard log messages when
loop=Noneand no event loop is running (due to internally usingasyncio.get_running_loop()in place ofasyncio.get_event_loop()). - Remove the possibility to add a coroutine sink with
enqueue=Trueifloop=Noneand no event loop is running. - Change default encoding of file sink to be
utf8instead oflocale.getpreferredencoding()(#339). - Prevent non-ascii characters to be escaped while logging JSON message with
serialize=True(#575, thanks @ponponon). - Fix
flake8errors and improve code readability (#353, thanks @AndrewYakimets).
0.5.3
0.5.2
- Fix
AttributeErrorwithin handlers usingserialize=Truewhen callinglogger.exception()outside of the context of an exception (#296). - Fix error while logging an exception containing a non-picklable
valueto a handler withenqueue=True(#298). - Add support for async callable classes (with
__call__method) used as sinks (#294, thanks @jessekrubin).
0.5.1
- Modify the way the
extradict is used byLogRecordin order to prevent possibleKeyErrorwith standardlogginghandlers (#271). - Add a new
defaultoptional argument tologger.catch(), it should be the returned value by the decorated function in case an error occurred (#272). - Fix
ValueErrorwhen usingserialize=Truein combination withlogger.catch()orlogger.opt(record=True)due to circular reference of therecorddict (#286).
0.5.0
- Remove the possibility to modify the severity
noof levels once they have been added in order to prevent surprising behavior (#209). - Add better support for "structured logging" by automatically adding
**kwargsto theextradict besides using these arguments to format the message. This behavior can be disabled by setting the new.opt(capture=False)parameter (#2). - Add a new
onerroroptional argument tologger.catch(), it should be a function which will be called when an exception occurs in order to customize error handling (#224). - Add a new
excludeoptional argument tologger.catch(), is should be a type of exception to be purposefully ignored and propagated to the caller without being logged (#248). - Modify
complete()to make it callable from non-asynchronous functions, it can thus be used ifenqueue=Trueto make sure all messages have been processed (#231). - Fix possible deadlocks on Linux when
multiprocessing.Process()collides withenqueue=Trueorthreading(#231). - Fix
compressionfunction not executable concurrently due to file renaming (to resolve conflicts) being performed after and not before it (#243). - Fix the filter function listing files for
retentionbeing too restrictive, it now matches files based on the pattern"basename(.*).ext(.*)"(#229). - Fix the impossibility to
remove()a handler if an exception is raised while the sink'stop()function is called (#237). - Fix file sink left in an unstable state if an exception occurred during
retentionorcompressionprocess (#238). - Fix situation where changes made to
record["message"]were unexpectedly ignored whenopt(colors=True), causing "out-of-date"messageto be logged due to implementation details (#221). - Fix possible exception if a stream having an
isatty()method returningTruebut not being compatible withcoloramais used on Windows (#249). - Fix exceptions occurring in coroutine sinks never retrieved and hence causing warnings (#227).
0.4.1
- Deprecate the
ansiparameter of.opt()in favor ofcolorswhich is a name more appropriate. - Prevent unrelated files and directories to be incorrectly collected thus causing errors during the
retentionprocess (#195, thanks @gazpachoking). - Strip color markups contained in
record["message"]when logging with.opt(ansi=True)instead of leaving them as is (#198). - Ignore color markups contained in
*argsand**kwargswhen logging with.opt(ansi=True), leave them as is instead of trying to use them to colorize the message which could cause undesirable errors (#197).