/// <summary> /// Create a filter for <see cref="Akka.Event.Warning"/> events. Events must match the specified pattern to be filtered. /// <example> /// Warning(pattern: new Regex("weird.*message"), source: obj) // filter on pattern and source /// </example> /// <remarks>Please note that filtering on the <paramref name="source"/> being /// <c>null</c> does NOT work (passing <c>null</c> disables the source filter). /// </remarks> /// </summary> /// <param name="pattern">The event must match the pattern to be filtered.</param> /// <param name="source">>Optional. The event source.</param> /// <returns>The new filter</returns> public IEventFilterApplier Warning(Regex pattern, string source = null) { var sourceMatcher = source == null ? null : new EqualsStringAndPathMatcher(source); var filter = new WarningFilter(new RegexMatcher(pattern), sourceMatcher); return(CreateApplier(filter, _system)); }
// --- Warning ------------------------------------------------------------------------------------------------ /// <summary> /// Create a filter for <see cref="Akka.Event.Warning"/> events. /// <para><paramref name="message" /> takes priority over <paramref name="start" />. /// If <paramref name="message" />!=<c>null</c> the event must match it to be filtered. /// If <paramref name="start" />!=<c>null</c> and <paramref name="message" /> has not been specified, /// the event must start with the given string to be filtered. /// If <paramref name="contains" />!=<c>null</c> and both <paramref name="message" /> and /// <paramref name="start" /> have not been specified, /// the event must contain the given string to be filtered. /// </para><example> /// Warning() // filter all Warning events /// Warning("message") // filter on exactly matching message /// Warning(source: obj) // filter on event source /// Warning(start: "Expected") // filter on start of message /// Warning(contains: "Expected") // filter on part of message /// </example> /// <remarks>Please note that filtering on the <paramref name="source"/> being /// <c>null</c> does NOT work (passing <c>null</c> disables the source filter). /// </remarks> /// </summary> /// <param name="message">Optional. If specified the event must match it exactly to be filtered.</param> /// <param name="start">Optional. If specified (and <paramref name="message"/> is not specified), the event must start with the string to be filtered.</param> /// <param name="contains">Optional. If specified (and neither <paramref name="message"/> nor <paramref name="start"/> are specified), the event must contain the string to be filtered.</param> /// <param name="source">Optional. The event source.</param> /// <returns>The new filter</returns> public IEventFilterApplier Warning(string message = null, string start = null, string contains = null, string source = null) { var messageMatcher = CreateMessageMatcher(message, start, contains); //This file has been auto generated. Do NOT modify this file directly var sourceMatcher = source == null ? null : new EqualsStringAndPathMatcher(source); var filter = new WarningFilter(messageMatcher, sourceMatcher); return(CreateApplier(filter, _system)); }