コード例 #1
0
ファイル: LogLevels.cs プロジェクト: FKLostLand/Zaku
        private LogLevels()
        {
            InvalidLogLevel = new LogLevelInfo(LogLevel.None, Color.IndianRed);

            LogLevelInfos = new LogLevelInfo[]
            {
                new LogLevelInfo(LogLevel.Trace, "Trace", UserSettings.DefaultTraceLevelColor, 10000, 0, 10000),
                new LogLevelInfo(LogLevel.Debug, "Debug", UserSettings.DefaultDebugLevelColor, 30000, 10001, 30000),
                new LogLevelInfo(LogLevel.Info, "Info", UserSettings.DefaultInfoLevelColor, 40000, 30001, 40000),
                new LogLevelInfo(LogLevel.Warn, "Warn", UserSettings.DefaultWarnLevelColor, 60000, 40001, 60000),
                new LogLevelInfo(LogLevel.Error, "Error", UserSettings.DefaultErrorLevelColor, 70000, 60001, 70000),
                new LogLevelInfo(LogLevel.Fatal, "Fatal", UserSettings.DefaultFatalLevelColor, 110000, 70001, 110000),
            };
        }
コード例 #2
0
 /// <summary>
 ///     The log as it was read.
 /// </summary>
 //TODO:
 //public string RawLog;
 public void CheckNull()
 {
     if (string.IsNullOrEmpty(LoggerName))
     {
         LoggerName = "Unknown";
     }
     if (string.IsNullOrEmpty(RootLoggerName))
     {
         RootLoggerName = "Unknown";
     }
     if (string.IsNullOrEmpty(Message))
     {
         Message = "Unknown";
     }
     if (string.IsNullOrEmpty(ThreadName))
     {
         ThreadName = string.Empty;
     }
     if (string.IsNullOrEmpty(ExceptionString))
     {
         ExceptionString = string.Empty;
     }
     if (string.IsNullOrEmpty(ExceptionString))
     {
         ExceptionString = string.Empty;
     }
     if (string.IsNullOrEmpty(CallSiteClass))
     {
         CallSiteClass = string.Empty;
     }
     if (string.IsNullOrEmpty(CallSiteMethod))
     {
         CallSiteMethod = string.Empty;
     }
     if (string.IsNullOrEmpty(SourceFileName))
     {
         SourceFileName = string.Empty;
     }
     if (Level == null)
     {
         Level = LogLevels.Instance[LogLevel.Error];
     }
 }
コード例 #3
0
ファイル: LogMessage.cs プロジェクト: olcayseker/Log2Console
 public void CheckNull()
 {
     if (string.IsNullOrEmpty(LoggerName))
         LoggerName = "Unknown";
     if (string.IsNullOrEmpty(Message))
         Message = "Unknown";
     if (string.IsNullOrEmpty(ThreadName))
         ThreadName = string.Empty;
     if (string.IsNullOrEmpty(ExceptionString))
         ExceptionString = string.Empty;
     if (string.IsNullOrEmpty(ExceptionString))
         ExceptionString = string.Empty;
     if (string.IsNullOrEmpty(CallSiteClass))
         CallSiteClass = string.Empty;
     if (string.IsNullOrEmpty(CallSiteMethod))
         CallSiteMethod = string.Empty;
     if (string.IsNullOrEmpty(SourceFileName))
         SourceFileName = string.Empty;
     if (Level == null)
         Level = LogLevels.Instance[(LogLevel.Error)];
 }
コード例 #4
0
ファイル: UserSettings.cs プロジェクト: pmorton/Log2Console
 private UserSettings()
 {
     // Set default values
     _logLevelInfo = LogLevels.Instance[(int)LogLevel.Trace];
 }
コード例 #5
0
ファイル: LogMessage.cs プロジェクト: olcayseker/Log2Console
        private LogLevels()
        {
            InvalidLogLevel = new LogLevelInfo(LogLevel.None, Color.IndianRed);

              LogLevelInfos = new LogLevelInfo[]
              {
            new LogLevelInfo(LogLevel.Trace, "Trace", UserSettings.DefaultTraceLevelColor, 10000, 0, 10000),
            new LogLevelInfo(LogLevel.Debug, "Debug", UserSettings.DefaultDebugLevelColor, 30000, 10001, 30000),
            new LogLevelInfo(LogLevel.Info, "Info", UserSettings.DefaultInfoLevelColor, 40000, 30001, 40000),
            new LogLevelInfo(LogLevel.Warn, "Warn", UserSettings.DefaultWarnLevelColor, 60000, 40001, 60000),
            new LogLevelInfo(LogLevel.Error, "Error", UserSettings.DefaultErrorLevelColor, 70000, 60001, 70000),
            new LogLevelInfo(LogLevel.Fatal, "Fatal", UserSettings.DefaultFatalLevelColor, 110000, 70001, 110000),
              };
        }