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.16k stars 81 forks source link

Additional information in InternalErrorLogger #17

Closed brian-imaginelearning closed 3 years ago

brian-imaginelearning commented 4 years ago

Would love to see additional information available in the InternalErrorLogger callback.

Currently errors in a log entry, such as a string formatting issue, just give an exception message something like "System.IndexOutOfRangeException: Index was outside the bounds of the array.". In addition, since the processing is being done asynchronously, the call stack of the exception has very little useful information.

So, any additional information that could be provided, such as the raw message before formatting, is critical in narrowing down which of thousands of log entries is the culprit for an internal error.

neuecc commented 3 years ago

Thanks, indeed. I've changed to public Action<LogInfo, Exception>? InternalErrorLogger { get; set; }.

neuecc commented 3 years ago

I've released 1.3.0.