NLog.Config.LoggingRule.NameMatches C# (CSharp) Method

NameMatches() public method

Checks whether given name matches the logger name pattern.
public NameMatches ( string loggerName ) : bool
loggerName string String to be matched.
return bool
        public bool NameMatches(string loggerName)
        {
            switch (this.loggerNameMatchMode)
            {
                case MatchMode.All:
                    return true;

                default:
                case MatchMode.None:
                    return false;

                case MatchMode.Equals:
                    return loggerName.Equals(this.loggerNameMatchArgument, StringComparison.Ordinal);

                case MatchMode.StartsWith:
                    return loggerName.StartsWith(this.loggerNameMatchArgument, StringComparison.Ordinal);

                case MatchMode.EndsWith:
                    return loggerName.EndsWith(this.loggerNameMatchArgument, StringComparison.Ordinal);

                case MatchMode.Contains:
                    return loggerName.IndexOf(this.loggerNameMatchArgument, StringComparison.Ordinal) >= 0;
            }
        }
    }