Table of Contents

Class QuietTextWriter

Namespace
log4net.Util
Assembly
log4net.dll

TextWriter that does not leak exceptions

public class QuietTextWriter : TextWriterAdapter, IDisposable, IAsyncDisposable
Inheritance
QuietTextWriter
Implements
Derived
Inherited Members

Remarks

QuietTextWriter does not throw exceptions when things go wrong. Instead, it delegates error handling to its IErrorHandler.

Constructors

QuietTextWriter(TextWriter, IErrorHandler)

Constructor

public QuietTextWriter(TextWriter writer, IErrorHandler errorHandler)

Parameters

writer TextWriter

the writer to actually write to

errorHandler IErrorHandler

the error handler to report error to

Remarks

Create a new QuietTextWriter using a writer and error handler

Properties

Closed

Gets a value indicating whether this writer is closed.

public bool Closed { get; }

Property Value

bool

true if this writer is closed, otherwise false.

Remarks

Gets a value indicating whether this writer is closed.

ErrorHandler

Gets or sets the error handler that all errors are passed to.

public IErrorHandler ErrorHandler { get; set; }

Property Value

IErrorHandler

The error handler that all errors are passed to.

Remarks

Gets or sets the error handler that all errors are passed to.

Methods

Close()

Closes the underlying output writer.

public override void Close()

Remarks

Closes the underlying output writer.

Write(char)

Writes a character to the underlying writer

public override void Write(char value)

Parameters

value char

the char to write

Remarks

Writes a character to the underlying writer

Write(char[], int, int)

Writes a buffer to the underlying writer

public override void Write(char[] buffer, int index, int count)

Parameters

buffer char[]

the buffer to write

index int

the start index to write from

count int

the number of characters to write

Remarks

Writes a buffer to the underlying writer

Write(string)

Writes a string to the output.

public override void Write(string value)

Parameters

value string

The string data to write to the output.

Remarks

Writes a string to the output.