Пример #1
0
 public static LoggingConfig ExtendLevel(this LoggingConfig loggingConfig)
 {
     try
     {
         loggingConfig.Levels = loggingConfig.Level.Split(',')?.Select(t => Convert.ToInt32(t))?.ToArray();
         return(loggingConfig);
     }
     catch (Exception)
     {
         return(loggingConfig);
     }
 }
Пример #2
0
 public static LoggingConfig ExtendStorageMediums(this LoggingConfig loggingConfig)
 {
     try
     {
         loggingConfig.StorageMediums = loggingConfig.StorageMedium.Split(',')?.Select(t => Convert.ToInt32(t))?.ToArray();
         return(loggingConfig);
     }
     catch (Exception)
     {
         return(loggingConfig);
     }
 }
Пример #3
0
        public static bool CheckLevelOpen(LoggingLevel loggingLevel)
        {
            switch (loggingLevel)
            {
            case LoggingLevel.Info: return(LoggingConfig.Get().Level_Info == 1);

            case LoggingLevel.Debug: return(LoggingConfig.Get().Level_Debug == 1);

            case LoggingLevel.Warn: return(LoggingConfig.Get().Level_Warn == 1);

            case LoggingLevel.Error: return(LoggingConfig.Get().Level_Error == 1);

            case LoggingLevel.Fatal: return(LoggingConfig.Get().Level_Fatal == 1);

            default: return(false);
            }
        }