Joutsen Logging v0.5.0+22-gec3d058
Public Member Functions | Properties | List of all members
Joutsen.Logging.ConsoleHandler Class Reference

A log handler that writes log entries to the console in configurable colors. More...

Public Member Functions

 ConsoleHandler (Formatter formatter)
 Creates a new instance. More...
 
override void Log (LogRecord record)
 Writes a log entry using the format provided by the Joutsen.Logging.StreamHandler.Formatter. More...
 
override void Dispose ()
 Frees the required resources. More...
 
- Public Member Functions inherited from Joutsen.Logging.StreamHandler
 StreamHandler (Stream stream, Formatter formatter, Encoding encoding=null)
 Creates a new instance of Joutsen.Logging.StreamHandler. More...
 
virtual void Log (LogRecord record)
 Writes a log entry using the format provided by the Joutsen.Logging.StreamHandler.Formatter. More...
 
virtual void Dispose ()
 Writes the remaining values to the stream before it is closed. More...
 
void Log (LogRecord record)
 

Properties

SimpleTypeConverter< LogRecord, ConsoleColor > ForegroundColorConverter [get, set]
 
SimpleTypeConverter< LogRecord, ConsoleColor > BackgroundColorConverter [get, set]
 
- Properties inherited from Joutsen.Logging.StreamHandler
Stream Stream [get, protected set]
 The stream to write to. More...
 
Filter Filter [get, set]
 An optional filter which determines if the record is handled by this handler. More...
 
Formatter Formatter [get, set]
 The formatter to be used to create the log entries which are written. More...
 
global::System.Text.Encoding Encoding [get, set]
 The encoding to use when writing to the stream. More...
 
bool AutoFlush [get, set]
 Determines if the records written are immediately flushed by the stream. More...
 
- Properties inherited from Joutsen.Logging.Handler
Filter Filter [get, set]
 An optional filter which determines if the record is handled by this handler. More...
 
Formatter Formatter [get, set]
 he formatter to be used to create the log entries which are written. More...
 
Encoding Encoding [get, set]
 The encoding of the output. More...
 

Additional Inherited Members

- Protected Attributes inherited from Joutsen.Logging.StreamHandler
TextWriter writer
 The see System.IO.TextWriter that is used to write to the stream. More...
 
bool firstRecordWritten
 Determines whether the first record has already been written. More...
 

Detailed Description

A log handler that writes log entries to the console in configurable colors.

Since
0.2.0

Constructor & Destructor Documentation

◆ ConsoleHandler()

Joutsen.Logging.ConsoleHandler.ConsoleHandler ( Formatter  formatter)

Creates a new instance.

Parameters
formatterthe formatter to use when writing log records

Member Function Documentation

◆ Dispose()

override void Joutsen.Logging.ConsoleHandler.Dispose ( )
virtual

Frees the required resources.

Remarks
After calling this method the handler can no longer write log entries.

Reimplemented from Joutsen.Logging.StreamHandler.

◆ Log()

override void Joutsen.Logging.ConsoleHandler.Log ( LogRecord  record)
virtual

Writes a log entry using the format provided by the Joutsen.Logging.StreamHandler.Formatter.

Parameters
recordthe record to write

Reimplemented from Joutsen.Logging.StreamHandler.

Property Documentation

◆ BackgroundColorConverter

SimpleTypeConverter<LogRecord, ConsoleColor> Joutsen.Logging.ConsoleHandler.BackgroundColorConverter
getset

◆ ForegroundColorConverter

SimpleTypeConverter<LogRecord, ConsoleColor> Joutsen.Logging.ConsoleHandler.ForegroundColorConverter
getset