コード例 #1
0
ファイル: Logger.cs プロジェクト: oguzhankiyar/OK.Logger
        public static ILogger New(Action <ILoggerConfigurator> configuratorAction)
        {
            ILogger logger = new Logger();

            ILoggerConfigurator configurator = new LoggerConfigurator(logger);

            configuratorAction.Invoke(configurator);

            return(logger);
        }
コード例 #2
0
        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);
            });
        }