v2.12.0
Highlights of 2.12.0
Improved and expanded <Nullable>enable</Nullable>
support
A huge number of commits have gone into completing and refining non-null reference type annotations, which now cover the entire public Serilog API. The Serilog project itself now builds with non-null reference type checking globally enabled 🎉
IAsyncDisposable
support
Sinks that need to flush changes using asynchronous APIs can now implement IAsyncDisposable
and prevent the possibility of deadlocking while waiting for tasks to complete.
To drive this, Logger
can now be disposed via using async
:
await using var log = new LoggerConfiguration().CreateLogger();
and the Log
class provides Log.CloseAndFlushAsync()
:
await Log.CloseAndFlushAsync();
DateOnly
and TimeOnly
support
The DateOnly
and TimeOnly
types introduced in .NET 6 are now correctly handled as scalar values when capturing.
Merged PRs
- #1713, #1716, #1715, #1722, #1721, #1720, #1729 - improved non-null reference type annotations (@SimonCropp)
- #1702 -
DateOnly
andTimeOnly
support (@SimonCropp) - #1764, #1703, #1708, #1709, #1712, #1724, #1730, #1747 - build and dependency updates (@SimonCropp)
- #1723, #1728, #1731, #1732, #1734, #1735, #1733, #1736, #1739, #1746, #1745, #1741, #1742 - code clean-up and modernization (@SimonCropp)
- #1750 -
IAsyncDisposable
support forLogger
and sinks (@nblumhardt) - #1699 - fix some XDOC documentation (@sungam3r)
- #1719 - remove redundant
!
operator fromnull
in conditions (@sungam3r) - #1725 - introduce file-scoped namespaces (@sungam3r)
- #1700, #1704, #1707 - more nulllable annotation updates (@nblumhardt)
- #1711 - fix support for
ValueTuple
(@SimonCropp)