Table of Contents

Class MessageWriter

Namespace
Dassie.Messages
Assembly
dc.dll

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

error MessageInfo

The 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

message string

The message to emit.

minimumVerbosity int

The minimum verbosity at which the message is printed.

defer bool

If 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

resourceId string

The name of the string resource to use.

args object[]

Arguments to format the string with.

minimumVerbosity int

The minimum verbosity at which the message is printed.

defer bool

If true, defers the emission of the message.

Returns

bool

true if the message was emitted or deferred.

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

ln int

The line of the error.

col int

The column of the error.

length int

The length the error.

errorType MessageCode

The error code of the message.

msg string

The error message.

file string

The file name to use in the error message.

tip string

An optional tip displayed in the message.

customErrorCode string

A custom error code. Can only be used if errorType is 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

ln int

The line of the error.

col int

The column of the error.

length int

The length of the error.

errorType MessageCode

The error code of the message.

resourceId string

The name of the string resource to use.

args object[]

Arguments to format the string with.

file string

The file name to use in the error message.

tip string

An optional tip displayed in the message.

customErrorCode string

A custom error code. Can only be used if errorType is 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

ln int

The line of the message.

col int

The column of the message.

length int

The length the message.

errorType MessageCode

The error code of the message.

msg string

The message.

file string

The file name to use in the message.

tip string

An optional tip displayed in the message.

customErrorCode string

A custom error code. Can only be used if errorType is 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

ln int

The line of the message.

col int

The column of the message.

length int

The length of the message.

errorType MessageCode

The error code of the message.

resourceId string

The name of the string resource to use.

args object[]

Arguments to format the string with.

file string

The file name to use in the message.

tip string

An optional tip displayed in the message.

customErrorCode string

A custom error code. Can only be used if errorType is 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

ln int

The line of the warning.

col int

The column of the warning.

length int

The length the warning.

errorType MessageCode

The error code of the message.

msg string

The warning message.

file string

The file name to use in the warning message.

tip string

An optional tip displayed in the message.

customErrorCode string

A custom error code. Can only be used if errorType is 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

ln int

The line of the warning.

col int

The column of the warning.

length int

The length of the warning.

errorType MessageCode

The error code of the message.

resourceId string

The name of the string resource to use.

args object[]

Arguments to format the string with.

file string

The file name to use in the warning message.

tip string

An optional tip displayed in the message.

customErrorCode string

A custom error code. Can only be used if errorType is 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

str string

The string to write.

WriteString(string)

Writes a string to the designated information outputs.

public static void WriteString(string str)

Parameters

str string

The string to write.