Beispiel #1
0
 void Log(EErrorLevel level, string format, params object[] args)
 {
     _allInfos.Add(new LogInfo()
     {
         level = level, info = string.Format(format, args)
     });
 }
Beispiel #2
0
 internal void Log(Exception ex, string additionalInfo = "", EErrorLevel errorLevel = EErrorLevel.Error, bool activate = true)
 {
     Log(
         ex.GetType() + (string.IsNullOrWhiteSpace(additionalInfo) ? "" : " (" + additionalInfo + ") ") + ":\r\n" + ex.ToString(),
         errorLevel,
         activate);
 }
Beispiel #3
0
    public void HandlerLog(EWorkStage stage, EErrorLevel level, ETipsType type, string fileName, int lineNum,
                           int colNum, params object[] args)
    {
        string lineInfo = (lineNum >= 0 ? ":" + lineNum.ToString() : "") +
                          (colNum >= 0 ? ", " + colNum.ToString() : "");

        Log(level, $"{stage} {level}_{((int)type)}: {fileName} {lineInfo} :  {string.Format(GetFormat(type), args)}\n");
        if (level == EErrorLevel.ERROR)
        {
            Exit();
        }
    }
Beispiel #4
0
 internal void Log(string msg, EErrorLevel errorLevel = EErrorLevel.Debug, bool activate = false)
 {
     if (errorLevel < LogLevel)
     {
         return;
     }
     try
     {
         _vsOutputWindowPane.OutputString(msg + "\r\n");
         if (activate)
         {
             _vsOutputWindowPane.Activate();
         }
     }
     catch
     { }
 }
Beispiel #5
0
 /// <summary>Get the background colour associated with this error level</summary>
 public static Colour32 Background(this EErrorLevel lvl)
 {
     return(lvl.Assoc <uint>("bg"));
 }
Beispiel #6
0
 /// <summary>Get the foreground colour associated with this error level</summary>
 public static Colour32 Foreground(this EErrorLevel lvl)
 {
     return(lvl.Assoc <uint>("fg"));
 }