コード例 #1
0
ファイル: Logger.cs プロジェクト: wesselvdeventer/sensenet
        private static void WritePrivate(object message, IEnumerable <string> categories = null, int priority = -1, int eventId = 1, TraceEventType severity = TraceEventType.Information, string title = null, IDictionary <string, object> properties = null)
        {
            switch (severity)
            {
            case TraceEventType.Critical:
            case TraceEventType.Error:
                SnLog.WriteError(message, eventId, categories, priority, title, properties);
                break;

            case TraceEventType.Warning:
                SnLog.WriteWarning(message, eventId, categories, priority, title, properties);
                break;

            case TraceEventType.Verbose:
                // do nothing: verbose log should be written using SnTrace
                break;

            case TraceEventType.Information:
                SnLog.WriteInformation(message, eventId, categories, priority, title, properties);
                break;

            default:
                SnLog.WriteInformation(severity + ": " + message, eventId, categories, priority, title, properties);
                break;
            }
        }
コード例 #2
0
ファイル: Logger.cs プロジェクト: wesselvdeventer/sensenet
 public static void WriteCritical(
     int eventId,
     object message,
     IEnumerable <string> categories = null,
     int priority = -1,
     string title = null,
     IDictionary <string, object> properties = null)
 {
     SnLog.WriteError(message, eventId, categories, priority, title, properties);
 }
コード例 #3
0
ファイル: Logger.cs プロジェクト: wesselvdeventer/sensenet
 public static void WriteCritical <T>(int eventId, object message, IEnumerable <string> categories, Func <T, IDictionary <string, object> > getPropertiesCallback, T callbackArg)
 {
     SnLog.WriteError(message, eventId, categories, properties: getPropertiesCallback?.Invoke(callbackArg));
 }
コード例 #4
0
ファイル: Logger.cs プロジェクト: wesselvdeventer/sensenet
 public static void WriteError <T>(object message, Func <T, IDictionary <string, object> > getPropertiesCallback, T callbackArg)
 {
     SnLog.WriteError(message, properties: getPropertiesCallback?.Invoke(callbackArg));
 }