19 lines
592 B
C#
19 lines
592 B
C#
using EonaCat.LogStack.Logging;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
|
|
namespace EonaCat.LogStack.Extensions;
|
|
|
|
public static class LoggingBuilderExtensions
|
|
{
|
|
public static ILoggingBuilder AddEonaCatLogging(this ILoggingBuilder builder, Action<EonaCatLogStack>? configure=null)
|
|
{
|
|
var logStack = new EonaCatLogStack();
|
|
configure?.Invoke(logStack);
|
|
builder.Services.AddSingleton(logStack);
|
|
builder.Services.AddSingleton<ILoggerProvider, EonaCatLoggerProvider>();
|
|
return builder;
|
|
}
|
|
}
|