Releases: Delgan/loguru
Releases · Delgan/loguru
0.4.0
- Add support for coroutine functions used as sinks and add the new
logger.complete()asynchronous method toawaitthem (#171). - Add a way to filter logs using one level per module in the form of a
dictpassed to thefilterargument (#148). - Add type hints to annotate the public methods using a
.pyistub file (#162). - Add support for
copy.deepcopy()of theloggerallowing multiple independent loggers with separate set of handlers (#72). - Add the possibility to convert
datetimeto UTC before formatting (in logs and filenames) by adding"!UTC"at the end of the time format specifier (#128). - Add the level
nameas the first argument of namedtuple returned by the.level()method. - Remove
classobjects from the list of supported sinks and restrict usage of**kwargsin.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. - Rename the
logger.configure()keyword argumentpatchtopatcherso it better matches the signature oflogger.patch(). - Fix incompatibility with
multiprocessingon Windows by entirely refactoring the internal structure of theloggerso it can be inherited by child processes along with added handlers (#108). - Fix
AttributeErrorwhile using a file sink on some distributions (like Alpine Linux) missing theos.getxattrandos.setxattrfunctions (#158, thanks @joshgordon). - Fix values wrongly displayed for keyword arguments during exception formatting with
diagnose=True(#144). - Fix logging messages wrongly chopped off at the end while using standard
logging.Handlersinks with.opt(raw=True)(#136). - Fix potential errors during rotation if destination file exists due to large resolution clock on Windows (#179).
- Fix an error using a
filterfunction "by name" while receiving a log withrecord["name"]equals toNone. - Fix incorrect record displayed while handling errors (if
catch=True) occurring because of non-picklable objects (ifenqueue=True). - Prevent hypothetical
ImportErrorif a Python installation is missing the built-indistutilsmodule (#118). - Raise
TypeErrorinstead ofValueErrorwhen aloggermethod is called with argument of invalid type. - Raise
ValueErrorif the built-informat()andfilter()functions are respectively used asformatandfilterarguments of theadd()method. This helps the user to understand the problem, as such a mistake can quite easily occur (#177). - Remove inheritance of some record dict attributes to
str(for"level","file","thread"and"process"). - Give a name to the worker thread used when
enqueue=True(#174, thanks @t-mart).
0.3.2
0.3.1
- Fix
retentionandrotationissues when file sink initiliazed withdelay=True(#113). - Fix
"sec"no longer recognized as a valid duration unit for filerotationandretentionarguments. - Ensure stack from the caller is displayed while formatting exception of a function decorated with
@logger.catchwhenbacktrace=False. - Modify datetime used to automatically rename conflicting file when rotating (it happens if file already exists because
"{time}"not presents in filename) so it's based on the file creation time rather than the current time.
0.3.0
- Remove all dependencies previously needed by
loguru(on Windows platform, it solely remainscoloramaandwin32-setctime). - Add a new
logger.patch()method which can be used to modify the record dict on-the-fly before it's being sent to the handlers. - Modify behavior of sink option
backtraceso it only extends the stacktrace upward, the display of variables values is now controlled with the newdiagnoseargument (#49). - Change behavior of
rotationoption 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). - Raise errors on unknowns color tags rather than silently ignoring them (#57).
- Add the possibility to auto-close color tags by using
</>(e.g.<yellow>message</>). - Add coloration of exception traceback even if
diagnoseandbacktraceoptions areFalse. - Add a way to limit the depth of formatted exceptions traceback by setting the conventional
sys.tracebacklimitvariable (#77). - Add
__repr__value to theloggerfor convenient debugging (#84). - Remove colors tags mixing directives (e.g.
<red,blue>) for simplification. - Make the
record["exception"]attribute unpackable as a(type, value, traceback)tuple. - Fix error happening in some rare circumstances because
frame.f_globalsdict did not contain"__name__"key and hence prevented Loguru to retrieve the module's name. From now,record["name"]will be equal toNonein such case (#62). - Fix logging methods not being serializable with
pickleand hence raising exception while being passed to somemultiprocessingfunctions (#102). - Fix exception stack trace not colorizing source code lines on Windows.
- Fix possible
AttributeErrorwhile formatting exceptions within acelerytask (#52). - Fix
logger.catchdecorator not working with generator and coroutine functions (#75). - Fix
record["path"]case being normalized for no necessary reason (#85). - Fix some Windows terminal emulators (mintty) not correctly detected as supporting colors, causing ansi codes to be automatically stripped (#104).
- Fix handler added with
enqueue=Truestopping working if exception was raised in sink althoughcatch=True. - Fix thread-safety of
enable()anddisable()being called during logging. - Use Tox to run tests (#41).
0.2.5
- Modify behavior of sink option
backtrace=Falseso it doesn't extend traceback upward automatically (#30). - Fix import error on some platforms using Python 3.5 with limited
localtime()support (#33). - Fix incorrect time formatting of locale month using
MMMandMMMMtokens (#34, thanks @nasyxx). - Fix race condition permitting writing on a stopped handler.