コード例 #1
0
 public static void LogInfo(UPSBrowserLogger.Categories category, string message)
 {
     try
     {
         TraceSeverity         severity  = TraceSeverity.Medium;
         SPDiagnosticsCategory _category = Local.Areas[LOG_AREA].Categories[category.ToString()];
         Local.WriteTrace(0, _category, severity, message);
         Debug.WriteLine(message);
     }
     catch
     {   // Don't want to do anything if logging goes wrong, just ignore and continue
     }
 }
コード例 #2
0
        public static void LogError(UPSBrowserLogger.Categories category, string message)
        {
            try
            {
                SPDiagnosticsCategory _category = Local.Areas[LOG_AREA].Categories[category.ToString()];

                TraceSeverity traceSeverity = TraceSeverity.High;
                Local.WriteTrace(0, _category, traceSeverity, message);

                EventSeverity eventSeverity = EventSeverity.Error;
                Local.WriteEvent(0, _category, eventSeverity, message);

                Debug.WriteLine(message);
            }
            catch
            {   // Don't want to do anything if logging goes wrong, just ignore and continue
            }
        }