Cysharp / ZLogger

Zero Allocation Text/Structured Logger for .NET with StringInterpolation and Source Generator, built on top of a Microsoft.Extensions.Logging.
MIT License
1.13k stars 80 forks source link

Make the log state to manage by reference counting #94

Closed hadashiA closed 7 months ago

hadashiA commented 8 months ago

This PR makes log state resource release a reference counting method as follows.

  1. state is created. +1
  2. (N times) each ZLogger provider posts to background worker. +1
  3. (N times) each ZLogger provider finishes a i/o write. -1
  4. After finishing the Logger.Log call (all Post calls should be finished). -1