[REFACTOR] Refactored logging & added support for Microsoft.Extensions.Logging. Added test WebApi project
This commit is contained in:
23
DotBased.Logging.MEL/BasedLoggerProvider.cs
Normal file
23
DotBased.Logging.MEL/BasedLoggerProvider.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace DotBased.Logging.MEL;
|
||||
|
||||
public class BasedLoggerProvider : ILoggerProvider
|
||||
{
|
||||
public BasedLoggerProvider(LogOptions options)
|
||||
{
|
||||
Options = options;
|
||||
}
|
||||
|
||||
private readonly LogOptions Options;
|
||||
|
||||
public Microsoft.Extensions.Logging.ILogger CreateLogger(string categoryName)
|
||||
{
|
||||
return new BasedLogger(Options.LoggerBuilder.Invoke(new LoggerInformation(typeof(BasedLoggerProvider)), categoryName));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user