NLog.LoggerImpl.WriteToTargetWithFilterChain C# (CSharp) Method

WriteToTargetWithFilterChain() private static method

private static WriteToTargetWithFilterChain ( NLog.Internal.TargetWithFilterChain targetListHead, LogEventInfo logEvent, AsyncContinuation onException ) : bool
targetListHead NLog.Internal.TargetWithFilterChain
logEvent LogEventInfo
onException AsyncContinuation
return bool
        private static bool WriteToTargetWithFilterChain(TargetWithFilterChain targetListHead, LogEventInfo logEvent, AsyncContinuation onException)
        {
            Target target = targetListHead.Target;
            FilterResult result = GetFilterResult(targetListHead.FilterChain, logEvent);

            if ((result == FilterResult.Ignore) || (result == FilterResult.IgnoreFinal))
            {
                if (InternalLogger.IsDebugEnabled)
                {
                    InternalLogger.Debug("{0}.{1} Rejecting message because of a filter.", logEvent.LoggerName, logEvent.Level);
                }

                if (result == FilterResult.IgnoreFinal)
                {
                    return false;
                }

                return true;
            }

            target.WriteAsyncLogEvent(logEvent.WithContinuation(onException));
            if (result == FilterResult.LogFinal)
            {
                return false;
            }

            return true;
        }