Closed longod closed 2 years ago
It seems that ZLoggerConsoleLoggerProvideruses System.Console's stream.
ZLoggerConsoleLoggerProvider
System.Console
https://github.com/Cysharp/ZLogger/blob/23e28e44537b97e77eeff5bee435fb54f0d11d9c/src/ZLogger/Providers/ZLoggerConsoleLoggerProvider.cs#L28
I tried to implement IAsyncLogProcessor using System.Diagnostics. It works. Such like as:
IAsyncLogProcessor
System.Diagnostics
using System.Threading.Tasks; using Microsoft.Extensions.Logging; using ZLogger; public class SimpleProcessor : IAsyncLogProcessor { private readonly ZLoggerOptions _options; public SimpleProcessor (ZLoggerOptions options) { _options = options; } public ValueTask DisposeAsync() { return default; } public void Post(IZLoggerEntry log) { try { var msg = log.FormatToString(_options, null); System.Diagnostics.Trace.WriteLine(msg); } finally { log.Return(); } } }
Do you have any plans to support this on non custom processor?
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.
It seems that
ZLoggerConsoleLoggerProvider
usesSystem.Console
's stream.https://github.com/Cysharp/ZLogger/blob/23e28e44537b97e77eeff5bee435fb54f0d11d9c/src/ZLogger/Providers/ZLoggerConsoleLoggerProvider.cs#L28
I tried to implement
IAsyncLogProcessor
usingSystem.Diagnostics
. It works. Such like as:Do you have any plans to support this on non custom processor?