Skip to content

4.8.0 - Implement LoggerFragment system for customizing logger output

Compare
Choose a tag to compare
@penny-for-vapor penny-for-vapor released this 18 Sep 09:44
· 19 commits to main since this release
dcaea6c

What's Changed

Implement LoggerFragment system for customizing logger output by @semicoleon in #182

This PR refactors ConsoleLogger to break out the functionality into smaller pieces. The goal of this is to allow end users to customize the log output without having to deal with writing a logger themselves. Things like adding a timestamp at the beginning of the log message can be accomplished without having to re-write any of the logic inside ConsoleKit by writing a custom LoggerFragment. Additionally, since the actual code for constructing the log message is so short, copying it to make modifications inside the message isn’t as much of a commitment as copying the whole ConsoleLogger implementation is.

This change would at least partially address #140 by making it easier to customize when metadata, etc is logged.

This change also incorporated moving from the deprecated Logging.LogHandler protocol method to the newer one which includes the source parameter

This patch was released by @gwynne

Full Changelog: 4.7.0...4.8.0