public static ILogger New(Action <ILoggerConfigurator> configuratorAction) { ILogger logger = new Logger(); ILoggerConfigurator configurator = new LoggerConfigurator(logger); configuratorAction.Invoke(configurator); return(logger); }
public static void UseOKLogger(this IServiceCollection services, Action <ILoggerConfigurator> configuratorAction) { ILogger logger = new Logger(); ILoggerConfigurator configurator = new LoggerConfigurator(logger); configuratorAction.Invoke(configurator); services.AddTransient((sp) => { return(logger); }); }