Class MessageWriter
Provides methods for emitting diagnostic messages.
public static class MessageWriter
- Inheritance
-
MessageWriter
- Inherited Members
Methods
Emit(MessageInfo)
Emits a message.
public static void Emit(MessageInfo error)
Parameters
errorMessageInfoThe message to emit.
EmitBuildLogMessage(string, int, bool)
Emits a build log message that is not caused by an error in the code.
public static bool EmitBuildLogMessage(string message, int minimumVerbosity = 2, bool defer = false)
Parameters
messagestringThe message to emit.
minimumVerbosityintThe minimum verbosity at which the message is printed.
deferboolIf true, defers the emission of the message until the next call to Dassie.Messages.MessageWriter.EmitDeferredBuildLogMessages().
Returns
- bool
true if the message was emitted or deferred. false if the message was not emitted due to an insufficient verbosity configuration.
EmitBuildLogMessageFormatted(string, object[], int, bool)
Emits a build log message using a localized string resource.
public static bool EmitBuildLogMessageFormatted(string resourceId, object[] args, int minimumVerbosity = 2, bool defer = false)
Parameters
resourceIdstringThe name of the string resource to use.
argsobject[]Arguments to format the string with.
minimumVerbosityintThe minimum verbosity at which the message is printed.
deferboolIf true, defers the emission of the message.
Returns
EmitErrorMessage(int, int, int, MessageCode, string, string, string, string)
Writes an error message to the designated error outputs.
public static void EmitErrorMessage(int ln = 0, int col = 0, int length = 0, MessageCode errorType = MessageCode.DS0001_UnknownError, string msg = "Unknown error.", string file = null, string tip = "", string customErrorCode = null)
Parameters
lnintThe line of the error.
colintThe column of the error.
lengthintThe length the error.
errorTypeMessageCodeThe error code of the message.
msgstringThe error message.
filestringThe file name to use in the error message.
tipstringAn optional tip displayed in the message.
customErrorCodestringA custom error code. Can only be used if
errorTypeis set to Custom.
EmitErrorMessageFormatted(int, int, int, MessageCode, string, object[], string, string, string)
Writes an error message to the designated error outputs using a localized string resource.
public static void EmitErrorMessageFormatted(int ln, int col, int length, MessageCode errorType, string resourceId, object[] args, string file = null, string tip = "", string customErrorCode = null)
Parameters
lnintThe line of the error.
colintThe column of the error.
lengthintThe length of the error.
errorTypeMessageCodeThe error code of the message.
resourceIdstringThe name of the string resource to use.
argsobject[]Arguments to format the string with.
filestringThe file name to use in the error message.
tipstringAn optional tip displayed in the message.
customErrorCodestringA custom error code. Can only be used if
errorTypeis set to Custom.
EmitMessage(int, int, int, MessageCode, string, string, string, string)
Writes a message to the designated information outputs.
public static void EmitMessage(int ln = 0, int col = 0, int length = 0, MessageCode errorType = MessageCode.DS0001_UnknownError, string msg = "Unknown error.", string file = null, string tip = "", string customErrorCode = null)
Parameters
lnintThe line of the message.
colintThe column of the message.
lengthintThe length the message.
errorTypeMessageCodeThe error code of the message.
msgstringThe message.
filestringThe file name to use in the message.
tipstringAn optional tip displayed in the message.
customErrorCodestringA custom error code. Can only be used if
errorTypeis set to Custom.
EmitMessageFormatted(int, int, int, MessageCode, string, object[], string, string, string)
Writes a message to the designated information outputs using a localized string resource.
public static void EmitMessageFormatted(int ln, int col, int length, MessageCode errorType, string resourceId, object[] args, string file = null, string tip = "", string customErrorCode = null)
Parameters
lnintThe line of the message.
colintThe column of the message.
lengthintThe length of the message.
errorTypeMessageCodeThe error code of the message.
resourceIdstringThe name of the string resource to use.
argsobject[]Arguments to format the string with.
filestringThe file name to use in the message.
tipstringAn optional tip displayed in the message.
customErrorCodestringA custom error code. Can only be used if
errorTypeis set to Custom.
EmitWarningMessage(int, int, int, MessageCode, string, string, string, string)
Writes a warning message to the designated warning outputs.
public static void EmitWarningMessage(int ln = 0, int col = 0, int length = 0, MessageCode errorType = MessageCode.DS0001_UnknownError, string msg = "Unknown error.", string file = null, string tip = "", string customErrorCode = null)
Parameters
lnintThe line of the warning.
colintThe column of the warning.
lengthintThe length the warning.
errorTypeMessageCodeThe error code of the message.
msgstringThe warning message.
filestringThe file name to use in the warning message.
tipstringAn optional tip displayed in the message.
customErrorCodestringA custom error code. Can only be used if
errorTypeis set to Custom.
EmitWarningMessageFormatted(int, int, int, MessageCode, string, object[], string, string, string)
Writes a warning message to the designated warning outputs using a localized string resource.
public static void EmitWarningMessageFormatted(int ln, int col, int length, MessageCode errorType, string resourceId, object[] args, string file = null, string tip = "", string customErrorCode = null)
Parameters
lnintThe line of the warning.
colintThe column of the warning.
lengthintThe length of the warning.
errorTypeMessageCodeThe error code of the message.
resourceIdstringThe name of the string resource to use.
argsobject[]Arguments to format the string with.
filestringThe file name to use in the warning message.
tipstringAn optional tip displayed in the message.
customErrorCodestringA custom error code. Can only be used if
errorTypeis set to Custom.
WriteLine(string)
Writes a string followed by a newline sequence to the designated information outputs.
public static void WriteLine(string str)
Parameters
strstringThe string to write.
WriteString(string)
Writes a string to the designated information outputs.
public static void WriteString(string str)
Parameters
strstringThe string to write.