v2.0.0
Rewrite for .NET 6
ZeroLog has been entirely rewritten to take advantage of new APIs in .NET 6 and new features of C# 10. Therefore, v2 only works on .NET 6 and above. A .NET Standard 2.0 target is provided to enable logging from libraries, but the main project needs to target .NET 6.
The surface API has been redesigned, but migration from v1 should still be straightforward (even though repetitive work is required).
See the readme file for more detailed information, and #44 for implementation notes.
Major changes
InfoFormat
(and similar) methods have been removed, they are replaced by the new interpolated string handlers feature of C# 10, which means the following code:is now equivalent to:_log.Info($"Hello {World()}!");
if (_log.IsInfoEnabled) { _log.Info() .Append("Hello ") .Append(World()) .Append("!") .Log(); }
- The
ILogEvent
interface has been removed, it's replaced by theLogMessage
class, in order to remove slower interface calls. - The
ILog
interface has been removed, it's replaced by theLog
class, for the same reason. - Appenders have been entirely redesinged, and the StringFormatter library has been replaced with built-in .NET 6 formatting features.
- ASCII values have been replaced with UTF-8.
- External JSON configuration has been removed. The library is now configured in code. Live configuration updates are possible (but allocate).
- The library now includes Roslyn analyzers that check for correct usage, and a new code fix for migration to the new syntax. See #45.