InMemoryLogger class

Thread safe logger that writes text to an in-memory buffer. The buffered text can be extracted using the ToString() method.

public sealed class InMemoryLogger : TextWriter, ILogger

Public Members

name description
InMemoryLogger() Initializes a new instance of the InMemoryLogger class.
override Encoding { get; } When overridden in a derived class, returns the character encoding in which the output is written.
TextWriter { get; } This property provides a TextWriter that implements ILogger which is handy if you have existing code that requires a TextWriter.
override ToString() Returns the logged text as a string.
override Write(…) Writes an informational string to the log.
Write(…) Writes a string to the log. (2 methods)
override WriteLine(…) Writes an informational string to the log.
WriteLine(…) Writes a string followed by a line terminator to the text string or stream. (2 methods)

Protected Members

name description
override Dispose(…) Releases the resources used by the logger.


See Logging for more information.

See Also