- 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 theloggerin 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_linenovalue (#1435). - Fix a regression preventing formatting of
record["time"]when usingzoneinfo.ZoneInfotimezones (#1260, thanks @bijlpieter). - Fix possible
ValueErrorraised on Windows when system clock was set far ahead in the future (#1291). - Fix externally raised
Exceptionpossibly causing invalid state generating repeatedRuntimeErrorof 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
Handlerrecords when usingenqueue=True(#1527). - Fix
catch=Truebeing ignored for exceptions raised during sink termination, such as file retention or compression triggered bylogger.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
ExceptionGrouperrors, which used a plural for a single remaining exception and could miss the closing ruler (#1541, thanks @JeremyL691). - Respect the
.levelattribute of standard loggingHandlerused as sink, which was previously ignored (#1409). - Allow the
rotationargument of file sinks to accept a list of rotation conditions, any of which can trigger the rotation (#1174, thanks @CollinHeist). - Honor the
NO_COLORenvironment variable which disables color output by default ifcolorizeis not provided (#1178). - Honor the
FORCE_COLORenvironment variable which enables color output by default ifcolorizeis not provided (#1305, thanks @nhurden). - Add requirement for
TERMenvironment 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).