Exemple #1
0
        //2
        public static ILogger BackgroundLoadFromJson(
            this LoggingWizardCharms charms,
            JToken loggingSection,
            IServiceProvider serviceProvider = null
            )
        {
            var baseLogger = new LoggerJsonLoader
            {
                Injector = serviceProvider
            }.Load(loggingSection);

            var bgLogger = baseLogger as BackgroundLogger;

            return(bgLogger ?? charms.BackgroundLogger(baseLogger));
        }
Exemple #2
0
        //1
        public static BackgroundLogger BackgroundLoadFromJson(
            this LoggingWizardCharms charms,
            string filePath,
            string sectionPath,
            IServiceProvider serviceProvider = null
            )
        {
            var baseLogger = new LoggerJsonLoader
            {
                Injector = serviceProvider
            }.Load(filePath, sectionPath);

            var bgLogger = baseLogger as BackgroundLogger;

            return(bgLogger ?? charms.BackgroundLogger(baseLogger));
        }