Class ConsoleDiagnosticMessageSink
Logs diagnostic messages to the system console.
public class ConsoleDiagnosticMessageSink : IMessageSink
- Inheritance
-
ConsoleDiagnosticMessageSink
- Implements
- Inherited Members
Methods
OnMessage(IMessageSinkMessage)
Reports the presence of a message on the message bus. This method should never throw exceptions.
public bool OnMessage(IMessageSinkMessage message)
Parameters
messageIMessageSinkMessageThe message from the message bus
Returns
- bool
Return
trueto continue running tests, orfalseto stop.
TryCreate(ConsoleHelper, bool, bool, bool, string?, bool)
Tries to create a new instance of the ConsoleDiagnosticMessageSink which will display instances
of IDiagnosticMessage and IInternalDiagnosticMessage to the Console.
May return null if both showDiagnosticMessages and showInternalDiagnosticMessages
are false.
public static ConsoleDiagnosticMessageSink? TryCreate(ConsoleHelper consoleHelper, bool noColor, bool showDiagnosticMessages = false, bool showInternalDiagnosticMessages = false, string? assemblyDisplayName = null, bool indent = true)
Parameters
consoleHelperConsoleHelperThe helper used to write console messages
noColorboolA flag to indicate that the user has asked for no color
showDiagnosticMessagesboolA flag to indicate whether diagnostic messages should be shown
showInternalDiagnosticMessagesboolA flag to indicate whether internal diagnostic messages should be shown
assemblyDisplayNamestringThe optional assembly display name to delineate the messages
indentboolWhether to indent the message