Exemple #1
0
 public QuickLoggerService(string setttingsAsJson) : this()
 {
     _configManager = new QuickLoggerStringConfigManager(setttingsAsJson);
     _settings      = _configManager.Load();
     foreach (var provider in _settings.Providers())
     {
         _quicklogger?.AddProvider(provider);
     }
     InitMessage();
 }
Exemple #2
0
 public QuickLoggerService(ILoggerSettingsPathFinder loggerSettingsPathFinder, IAdditionalLoggerInfoProviderService additionalInfoProvider = null) : this()
 {
     _loggerSettingsPathFinder     = loggerSettingsPathFinder;
     _additionalLoggerInfoProvider = additionalInfoProvider;
     _settings = LoadConfigFromDisk();
     foreach (var provider in _settings.Providers())
     {
         try
         {
             var providername = String.Format("[Name : {0}] - [PID : {1}] - [GUID : {2}]", provider.getProviderProperties().GetProviderName(),
                                              System.Diagnostics.Process.GetCurrentProcess().Id, Guid.NewGuid().ToString());
             provider.getProviderProperties().SetProviderName(providername);
             _quicklogger?.AddProvider(provider);
         }
         catch (Exception ex)
         {
             //TODO : Turrican -> Do something with this! Case provider cannot be added...
         }
     }
     InitMessage();
 }
Exemple #3
0
 private void InitMessage()
 {
     _quicklogger?.Success("QuickLogger loaded -> version " + _quicklogger?.GetLoggerNameAndVersion());
     _settings.Providers().ForEach(x => _quicklogger?.Info(x.getProviderProperties().GetProviderName() + " Provider Initalized."));
 }