Пример #1
0
 private LoggerPhaseScope(CapturedLoggerPhaseScope captured, LogLevel?perfLogLevel)
 {
     _originPhaseName = GetPhaseName();
     SetPhaseName(captured.PhaseName);
     if (perfLogLevel != null)
     {
         _performanceScope = new PerformanceScope("Scope:" + captured.PhaseName, perfLogLevel.Value);
     }
 }
Пример #2
0
 private LoggerPhaseScope(CapturedLoggerPhaseScope captured, bool enablePerformanceScope)
 {
     _originPhaseName = GetPhaseName();
     SetPhaseName(captured.PhaseName);
     if (enablePerformanceScope)
     {
         _performanceScope = new PerformanceScope("Scope:" + captured.PhaseName, LogLevel.Diagnostic);
     }
 }
Пример #3
0
 private LoggerPhaseScope(CapturedLoggerPhaseScope captured, bool enablePerformanceScope)
 {
     _originPhaseName = GetPhaseName();
     SetPhaseName(captured.PhaseName);
     if (enablePerformanceScope)
     {
         _performanceScope = new PerformanceScope("Scope:" + captured.PhaseName, LogLevel.Diagnostic);
     }
 }
Пример #4
0
 public LoggerPhaseScope(string phaseName, bool enablePerformanceScope)
 {
     if (string.IsNullOrWhiteSpace(phaseName))
     {
         throw new ArgumentException("Phase name cannot be null or white space.", nameof(phaseName));
     }
     _originPhaseName = GetPhaseName();
     SetPhaseName(_originPhaseName == null ? phaseName : _originPhaseName + "." + phaseName);
     if (enablePerformanceScope)
     {
         _performanceScope = new PerformanceScope("Scope:" + phaseName, LogLevel.Diagnostic);
     }
 }
Пример #5
0
 private LoggerPhaseScope(string phaseName, LogLevel?perfLogLevel)
 {
     if (string.IsNullOrWhiteSpace(phaseName))
     {
         throw new ArgumentException("Phase name cannot be null or white space.", nameof(phaseName));
     }
     _originPhaseName = GetPhaseName();
     phaseName        = _originPhaseName == null ? phaseName : _originPhaseName + "." + phaseName;
     SetPhaseName(phaseName);
     if (perfLogLevel != null)
     {
         _performanceScope = new PerformanceScope("Scope:" + phaseName, perfLogLevel.Value);
     }
 }
Пример #6
0
 public LoggerPhaseScope(string phaseName, bool enablePerformanceScope)
 {
     if (string.IsNullOrWhiteSpace(phaseName))
     {
         throw new ArgumentException("Phase name cannot be null or white space.", nameof(phaseName));
     }
     _originPhaseName = GetPhaseName();
     phaseName = _originPhaseName == null ? phaseName : _originPhaseName + "." + phaseName;
     SetPhaseName(phaseName);
     if (enablePerformanceScope)
     {
         _performanceScope = new PerformanceScope("Scope:" + phaseName, LogLevel.Diagnostic);
     }
 }
Пример #7
0
        private LoggerPhaseScope(CapturedLoggerPhaseScope captured, LogLevel?perfLogLevel)
        {
            _originPhaseName = GetPhaseName();
            var context = captured.CurrentAmbientContext;

            if (context.HasValue)
            {
                _ac = new AmbientContext(context.Value);
            }
            SetPhaseName(captured.PhaseName);
            if (perfLogLevel != null)
            {
                _performanceScope = new PerformanceScope("Scope:" + captured.PhaseName, perfLogLevel.Value);
            }
        }
Пример #8
0
        private LoggerPhaseScope(string phaseName, LogLevel?perfLogLevel, AggregatedPerformanceScope aggregatedPerformanceLogger)
        {
            if (string.IsNullOrWhiteSpace(phaseName))
            {
                throw new ArgumentException("Phase name cannot be null or white space.", nameof(phaseName));
            }

            _ac = AmbientContext.GetOrCreateAmbientContext().CreateBranch();

            _originPhaseName = GetPhaseName();
            phaseName        = _originPhaseName == null ? phaseName : _originPhaseName + "." + phaseName;
            SetPhaseName(phaseName);
            if (perfLogLevel != null)
            {
                _performanceScope = new PerformanceScope("Scope:" + phaseName, perfLogLevel.Value, aggregatedPerformanceLogger);
            }
        }