public static void Log(LogLevel level, string message, string phase = null, string file = null, string line = null) { Log(new LogItem { File = file ?? LoggerFileScope.GetFileName(), Line = line, LogLevel = level, Message = message, Phase = phase ?? LoggerPhaseScope.GetPhaseName(), }); }
public void Log(TimeSpan elapsedTime) { var phaseName = LoggerPhaseScope.GetPhaseName(); if (string.IsNullOrEmpty(phaseName)) { return; } var aggregatedPerformanceByPhase = _aggregatedPerformanceByPhase.GetOrAdd(phaseName, _ => new Lazy <AggregatedPerformance>(() => new AggregatedPerformance())).Value; aggregatedPerformanceByPhase.Log(elapsedTime.TotalMilliseconds); }
public static void Log(LogLevel level, string message, string phase = null, string file = null, string line = null) { Log(new LogItem { #if NetCore File = file, #else File = file ?? LoggerFileScope.GetFileName(), #endif Line = line, LogLevel = level, Message = message, #if NetCore Phase = phase, #else Phase = phase ?? LoggerPhaseScope.GetPhaseName(), #endif }); }