pypi loguru 0.8.0

49 minutes ago
  • Change the default log format to include the timezone offset since it produces less ambiguous logs (#856, thanks @tim-x-y-z).
  • Add new logger.reinstall() method to automatically set up the logger in spawned child processes (#818, thanks @monchin).
  • Add support for template strings used as log messages (#1397, thanks @TurtleOrangina).
  • Add record["template"] that includes the raw, unformatted message (#1349, thanks @sentrivana).
  • Fix incorrect microsecond value when formatting the log timestamp using {time:x} (#1440).
  • Fix parsing of 12-hour rotation times without seconds (#1474, thanks @c-tonneslan).
  • Fix a "<weekday> at <time>" rotation firing its first rotation on the creation day instead of the requested weekday when the time of day was later than the creation time (#1484, thanks @gaoflow).
  • Fix hex color short code expansion (#1426, thanks @turkoid).
  • Fix possible regular expression denial of service (ReDoS) when parsing color markups in strings containing long sequences of backslashes (#1537).
  • Fix possible internal error when dealing with (rare) frame objects missing a f_lineno value (#1435).
  • Fix a regression preventing formatting of record["time"] when using zoneinfo.ZoneInfo timezones (#1260, thanks @bijlpieter).
  • Fix possible ValueError raised on Windows when system clock was set far ahead in the future (#1291).
  • Fix externally raised Exception possibly causing invalid state generating repeated RuntimeError of avoided deadlock (#1335).
  • Fix incorrect formatting of negative timezone offsets with sub-minute components (#1500).
  • Fix incorrect formatting of negative timestamps (#1501).
  • Fix incorrect thread and process identifiers of standard logging Handler records when using enqueue=True (#1527).
  • Fix catch=True being ignored for exceptions raised during sink termination, such as file retention or compression triggered by logger.remove() (#1532).
  • Fix logger.parse() decoding log files with the locale encoding instead of UTF-8 when given a path, which failed on non-ASCII logs written using the file sink default encoding on Windows (#1540).
  • Fix formatting of truncated ExceptionGroup errors, which used a plural for a single remaining exception and could miss the closing ruler (#1541, thanks @JeremyL691).
  • Respect the .level attribute of standard logging Handler used as sink, which was previously ignored (#1409).
  • Allow the rotation argument of file sinks to accept a list of rotation conditions, any of which can trigger the rotation (#1174, thanks @CollinHeist).
  • Honor the NO_COLOR environment variable which disables color output by default if colorize is not provided (#1178).
  • Honor the FORCE_COLOR environment variable which enables color output by default if colorize is not provided (#1305, thanks @nhurden).
  • Add requirement for TERM environment variable not to be "dumb" to enable colorization (#1287, thanks @snosov1).
  • Make logger.catch() usable as an asynchronous context manager (#1084).
  • Make logger.catch() compatible with asynchronous generators (#1302).
  • Improve feedback for invalid format keys in logger format strings (#1450, thanks @Krishnachaitanyakc).

Don't miss a new loguru release

NewReleases is sending notifications on new releases.