Ejemplo n.º 1
0
        public void Create_Save_And_Load_logger_configuration_from_disk()
        {
            ILoggerConfigManager configmanager = GetaTestConfigManager(_configPath);
            ILoggerSettings      settings      = configmanager.Load();

            settings.setEnvironment(_environmentName);
            settings.addProvider(GetaTestProvider(_testprovidername));
            configmanager.Write();
            Assert.That(File.Exists(_configPath), Is.True);
            Assert.That(configmanager.Reset(), Is.Null);
            settings = configmanager.Load();
            Assert.That(settings, !Is.Null);
            Assert.That(settings.getProvider(_testprovidername), !Is.Null);
        }
        public void Create_logger_configuration_from_string()
        {
            ILoggerConfigManager configmanager = GetTestStringConfigManager();

            configmanager.Load();
            Assert.That(configmanager.GetSettings(), !Is.Null);
            Assert.That(configmanager.GetSettings().getProvider(_testprovidername), !Is.Null);
        }
Ejemplo n.º 3
0
        public void Add_Logger_provider_into_a_new_configuration_manager()
        {
            ILoggerConfigManager configmanager = GetaTestConfigManager(_configPath);
            ILoggerSettings      settings      = configmanager.Load();

            settings.setEnvironment(_environmentName);
            settings.addProvider(GetaTestProvider(_testprovidername));
            Assert.That(settings.getProvider(_testprovidername), !Is.Null);
        }
Ejemplo n.º 4
0
        public void Make_default_settings_and_save_to_disk()
        {
            ILoggerConfigManager configmanager = GetaTestConfigManager(_configPath);
            ILoggerSettings      settings      = configmanager.Load();

            settings.setEnvironment(_environmentName);
            settings.addProvider(GetaTestProvider(_testprovidername));
            configmanager.Write();
            Assert.That(File.Exists(_configPath), Is.True);
        }
Ejemplo n.º 5
0
 public QuickLoggerService(string setttingsAsJson) : this()
 {
     _configManager = new QuickLoggerStringConfigManager(setttingsAsJson);
     _settings      = _configManager.Load();
     foreach (var provider in _settings.Providers())
     {
         _quicklogger?.AddProvider(provider);
     }
     InitMessage();
 }
Ejemplo n.º 6
0
        private ILoggerSettings LoadConfigFromDisk()
        {
            var quickloggerconfigpath = _loggerSettingsPathFinder.GetSettingsPath();

            if (!Path.IsPathRooted(quickloggerconfigpath))
            {
                quickloggerconfigpath = Path.Combine(currentPath, "..", quickloggerconfigpath);
            }
            _configManager = new QuickLoggerFileConfigManager(quickloggerconfigpath);
            return(_configManager.Load());
        }
        public void Create_Save_And_Load_logger_configuration_from_disk()
        {
            ILoggerConfigManager configmanager = GetaTestFileConfigManager(_configPath);

            configmanager.GetSettings().addProvider(GetaTestProvider(_testprovidername));
            configmanager.Write();
            Assert.That(File.Exists(_configPath), Is.True);
            configmanager.Load();
            Assert.That(configmanager.GetSettings(), !Is.Null);
            Assert.That(configmanager.GetSettings().getProvider(_testprovidername), !Is.Null);
        }