Skip to main content

Class Output

Provides utility methods for outputting debug information.

Assembly: Meadow.dll
View Source
public static class Output

Methods

WriteIf(bool, string)

Writes the specified string to the log if the test condition is true (conditional debug output).

View Source
[Conditional("DEBUG")]
public static void WriteIf(bool test, string value)
Parameters
TypeNameDescription
System.BooleantestThe condition to test.
System.StringvalueThe value to write to the log.

WriteLineIf(bool, string)

Writes the specified string followed by a line terminator to the log if the test condition is true (conditional debug output).

View Source
[Conditional("DEBUG")]
public static void WriteLineIf(bool test, string value)
Parameters
TypeNameDescription
System.BooleantestThe condition to test.
System.StringvalueThe value to write to the log.

Write(string)

Writes the specified string to the log (conditional debug output).

View Source
[Conditional("DEBUG")]
public static void Write(string value)
Parameters
TypeNameDescription
System.StringvalueThe value to write to the log.

WriteLine(string)

Writes the specified string followed by a line terminator to the log (conditional debug output).

View Source
[Conditional("DEBUG")]
public static void WriteLine(string value)
Parameters
TypeNameDescription
System.StringvalueThe value to write to the log.

BufferIf(bool, byte[])

Output the buffer in hexadecimal if the condition is met.

View Source
public static void BufferIf(bool test, byte[] buffer)
Parameters
TypeNameDescription
System.BooleantestDetermine if the method should generate any output.
System.Byte[]bufferByte array of the buffer to be converted to printable format.

BufferIf(bool, byte[], int, int)

Output the buffer in hexadecimal if the condition is met.

View Source
public static void BufferIf(bool test, byte[] buffer, int offset, int length)
Parameters
TypeNameDescription
System.BooleantestDetermine if the method should generate any output.
System.Byte[]bufferByte array of the buffer to be converted to printable format.
System.Int32offsetOffset into the buffer to start the data display.
System.Int32lengthAmount of data to display.

Buffer(byte[])

Output the buffer in hexadecimal.

View Source
public static void Buffer(byte[] buffer)
Parameters
TypeNameDescription
System.Byte[]bufferByte array of the buffer to be converted to printable format.