Beispiel #1
0
        static Errors()
        {
            Set <int> codes = new Set <int>();

            // verify integrity of error codes
            foreach (FieldInfo fi in typeof(Errors).GetFields(BindingFlags.Public | BindingFlags.Static))
            {
                ErrorDesc error_desc = (ErrorDesc)fi.GetValue(null);

                switch (error_desc.Severity)
                {
                case Severity.Error:    Debug.Assert(error_desc.ErrorCode < 2000); break;

                case Severity.Warning:  Debug.Assert(error_desc.ErrorCode >= 2000 && error_desc.ErrorCode < 3000); break;

                case Severity.Info:     Debug.Assert(error_desc.ErrorCode >= 3000); break;
                }

                Debug.Assert(!codes.Contains(error_desc.ErrorCode));
                codes.Add(error_desc.ErrorCode);
            }
        }
Beispiel #2
0
 public void Add(ErrorDesc error, params object[] args)
 {
     Add(new LogEntry(error.ErrorCode, error.Severity, String.Format(error.Message, args)));
 }
Beispiel #3
0
 public void Add(ErrorDesc error, object arg1, object arg2, object arg3)
 {
     Add(new LogEntry(error.ErrorCode, error.Severity, String.Format(error.Message, arg1, arg2, arg3)));
 }
Beispiel #4
0
 public void Add(ErrorDesc error)
 {
     Add(new LogEntry(error.ErrorCode, error.Severity, error.Message));
 }
Beispiel #5
0
 public void Add(ErrorDesc error, params object[] args)
 {
     Add(new LogEntry(error.ErrorCode, error.Severity, String.Format(error.Message, args)));
 }
Beispiel #6
0
 public void Add(ErrorDesc error, object arg1, object arg2, object arg3)
 {
     Add(new LogEntry(error.ErrorCode, error.Severity, String.Format(error.Message, arg1, arg2, arg3)));
 }
Beispiel #7
0
 public void Add(ErrorDesc error)
 {
     Add(new LogEntry(error.ErrorCode, error.Severity, error.Message));
 }