Example #1
0
        private static TraceReport Log <T>(TraceLevel level, TraceReport trace, Func <T> data, Enum code = null, string correlation = null)
        {
            var entry = new LogEntry <T>(level, new Lazy <T>(data))
            {
                Code          = code,
                CorrelationId = correlation
            };

            trace.Log(entry);
            return(trace);
        }
Example #2
0
 public static TraceReport Error <T>(this TraceReport trace, Func <T> factory) => Log(TraceLevel.Error, trace, factory);
Example #3
0
 public static TraceReport Critical <T>(this TraceReport trace, Func <T> factory) => Log(TraceLevel.Critical, trace, factory);
Example #4
0
 public static TraceReport Error <T>(this TraceReport trace, T data) => Log(TraceLevel.Error, trace, data);
Example #5
0
 public static TraceReport Critical <T>(this TraceReport trace, T data) => Log(TraceLevel.Critical, trace, data);