forked from Cysharp/ZLogger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
378 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...er/Providers/ZLogConsoleLoggerProvider.cs → ...Providers/ZLoggerConsoleLoggerProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,30 @@ | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Extensions.Options; | ||
using System; | ||
using System.IO; | ||
|
||
namespace ZLogger.Providers | ||
|
||
{ | ||
|
||
[ProviderAlias("ZLoggerLogProcessorProvider")] | ||
public class ZLoggerLogProcessorProvider : ILoggerProvider | ||
{ | ||
IAsyncLogProcessor processor; | ||
|
||
public ZLoggerLogProcessorProvider(IAsyncLogProcessor processor, IOptions<ZLoggerOptions> options) | ||
{ | ||
this.processor = processor; | ||
} | ||
|
||
public ILogger CreateLogger(string categoryName) | ||
{ | ||
return new AsyncProcessZLogger(categoryName, processor); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
processor.DisposeAsync().AsTask().Wait(); | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,29 @@ | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Extensions.Options; | ||
using System; | ||
using System.IO; | ||
|
||
namespace ZLogger.Providers | ||
{ | ||
|
||
[ProviderAlias("ZLoggerStream")] | ||
public class ZLoggerStreamLoggerProvider : ILoggerProvider | ||
{ | ||
AsyncStreamLineMessageWriter streamWriter; | ||
|
||
public ZLoggerStreamLoggerProvider(Stream stream, IOptions<ZLoggerOptions> options) | ||
{ | ||
this.streamWriter = new AsyncStreamLineMessageWriter(stream, options.Value); | ||
} | ||
|
||
public ILogger CreateLogger(string categoryName) | ||
{ | ||
return new AsyncProcessZLogger(categoryName, streamWriter); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
streamWriter.DisposeAsync().AsTask().Wait(); | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters