Photon Quantum 3.0.0

Public Member Functions | List of all members
Quantum.TextWriterLogStream Class Reference

A log stream that writes log messages to a TextWriter. More...

Inheritance diagram for Quantum.TextWriterLogStream:
Quantum.LogStream Quantum.ConsoleLogStream

Public Member Functions

 TextWriterLogStream (TextWriter writer, bool disposeWriter, string prefix=null)
 Initializes a new instance of the TextWriterLogStream class. More...
 
override void Dispose ()
 Disposes the TextWriterLogStream instance and optionally disposes the underlying TextWriter. More...
 
override void Log (Exception error)
 Logs an exception. More...
 
override void Log (ILogSource source, string message)
 Logs a message with a source. More...
 
override void Log (ILogSource source, string message, Exception error)
 Logs a message with a source and an exception. More...
 
override void Log (string message)
 Logs a message. More...
 
override void Log (string message, Exception error)
 Logs a message with an exception. More...
 
- Public Member Functions inherited from Quantum.LogStream
virtual void Log (ILogSource source, Exception error)
 Logs a message with an exception. More...
 

Detailed Description

A log stream that writes log messages to a TextWriter.

Constructor & Destructor Documentation

◆ TextWriterLogStream()

Quantum.TextWriterLogStream.TextWriterLogStream ( TextWriter  writer,
bool  disposeWriter,
string  prefix = null 
)
inline

Initializes a new instance of the TextWriterLogStream class.

Parameters
writerThe TextWriter to write log messages to.
disposeWriterIf set to true, the writer will be disposed when this instance is disposed.
prefixAn optional prefix to prepend to each log message.
Exceptions
ArgumentNullExceptionThrown if writer is null.

Member Function Documentation

◆ Log() [1/5]

override void Quantum.TextWriterLogStream.Log ( ILogSource  source,
string  message 
)
inlinevirtual

Logs a message with a source.

Parameters
sourceThe source of the log message.
messageThe log message.

Reimplemented from Quantum.LogStream.

◆ Log() [2/5]

override void Quantum.TextWriterLogStream.Log ( string  message)
inlinevirtual

Logs a message.

Parameters
messageThe log message.

Implements Quantum.LogStream.

◆ Log() [3/5]

override void Quantum.TextWriterLogStream.Log ( ILogSource  source,
string  message,
Exception  error 
)
inlinevirtual

Logs a message with a source and an exception.

Parameters
sourceThe source of the log message.
messageThe log message.
errorThe exception to log.

Reimplemented from Quantum.LogStream.

◆ Log() [4/5]

override void Quantum.TextWriterLogStream.Log ( string  message,
Exception  error 
)
inlinevirtual

Logs a message with an exception.

Parameters
messageThe log message.
errorThe exception to log.

Reimplemented from Quantum.LogStream.

◆ Log() [5/5]

override void Quantum.TextWriterLogStream.Log ( Exception  error)
inlinevirtual

Logs an exception.

Parameters
errorThe exception to log.

Implements Quantum.LogStream.

◆ Dispose()

override void Quantum.TextWriterLogStream.Dispose ( )
inlinevirtual

Disposes the TextWriterLogStream instance and optionally disposes the underlying TextWriter.

Reimplemented from Quantum.LogStream.