コード例 #1
0
ファイル: Logger.cs プロジェクト: yodamaster/docfx
 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(),
     });
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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
            });
        }