Beispiel #1
0
        public void Intercept(IInvocation invocation)
        {
            if (invocation == null)
            {
                throw new System.ArgumentNullException(nameof(invocation));
            }

            if (loggingService.IsTraceDisabled())
            {
                invocation.Proceed();
            }
            else
            {
                HandleInterception(invocation);
            }
        }
        public bool IsEnabled(LogLevel logLevel)
        {
            switch (logLevel)
            {
            case LogLevel.Trace:
            case LogLevel.Debug:
                return(!applicationLogger.IsTraceDisabled());

            case LogLevel.Information:
            case LogLevel.Warning:
            case LogLevel.Error:
            case LogLevel.Critical:
            case LogLevel.None:
            default:
                return(true);
            }
        }