Example #1
0
 public SPDiagnosticsCategory this[BaristaDiagnosticCategory id]
 {
     get
     {
         return(Areas[DiagnosticsAreaName].Categories[id.ToString()]);
     }
 }
Example #2
0
        public void LogMessage(ushort id, BaristaDiagnosticCategory category,
                               TraceSeverity traceSeverity, string message, params object[] data)
        {
            if (traceSeverity == TraceSeverity.None)
            {
                return;
            }

            var cat = this[category];

            Local.WriteTrace(id, cat, traceSeverity, message, data);
        }
Example #3
0
        public void LogException(Exception ex, BaristaDiagnosticCategory category, string messagePrefix)
        {
            if (messagePrefix == null)
            {
                messagePrefix = String.Empty;
            }

            if (messagePrefix != String.Empty)
            {
                messagePrefix = messagePrefix.TrimEnd() + " ";
            }

            var cat = this[category];

            Local.WriteTrace(1, cat, TraceSeverity.Unexpected, messagePrefix + ex.Message, ex.Data);
        }