Enhanced C#
Language of your choice: library documentation
|
A decorator that uses a delegate to accept or ignore messages. More...
A decorator that uses a delegate to accept or ignore messages.
The filter can accept or reject messages based on both the message type and the actual message (format string). When someone calls IsEnabled(Severity), the filter is invoked with only the type; the message is set to null. Accepted messages are sent to the Target message sink.
Properties | |
Func< Severity, object, string, bool > | Filter [get, set] |
Func< Severity, bool > | TypeFilter [get, set] |
IMessageSink | Target [get, set] |
Public Member Functions | |
MessageFilter (Func< Severity, object, string, bool > filter, IMessageSink target) | |
MessageFilter (Func< Severity, bool > filter, IMessageSink target) | |
void | Write (Severity type, object context, string format) |
Writes a message to the target that this object represents. More... | |
void | Write (Severity type, object context, string format, object arg0, object arg1=null) |
void | Write (Severity type, object context, string format, params object[] args) |
bool | IsEnabled (Severity type) |
Returns true if Filter(type, null) and target.IsEnabled(type) are both true. More... | |
|
inline |
Returns true if Filter(type, null)
and target.IsEnabled(type)
are both true.
Implements Loyc.IMessageSink.
Writes a message to the target that this object represents.
type | Severity or importance of the message; widely-used types include Error, Warning, Note, Debug, and Verbose. The special type Detail is intended to provide more information about a previous message. |
context | An object that the message is related to, or that represents the location that the message applies to. The message sink may try to convert this object to a string and include it in its output. See also MessageSink.LocationString(). |
format | A message to display. If there are additional arguments, placeholders such as {0} and {1} refer to these arguments. |
Implements Loyc.IMessageSink.