C# Class NLog.Targets.ColoredConsoleTarget

Inheritance: NLog.Targets.TargetWithLayoutHeaderAndFooter
Show file Open project: NLog/NLog Class Usage Examples

Private Properties

Property Type Description
ColorizeEscapeSequences void
GetMatchingRowHighlightingRule NLog.Targets.ConsoleRowHighlightingRule
IsColorChange bool
WriteToOutput void

Public Methods

Method Description
ColoredConsoleTarget ( ) : NLog.Common

Initializes a new instance of the ColoredConsoleTarget class.

The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message}

ColoredConsoleTarget ( string name ) : NLog.Common

Initializes a new instance of the ColoredConsoleTarget class.

The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message}

Protected Methods

Method Description
CloseTarget ( ) : void

Closes the target and releases any unmanaged resources.

InitializeTarget ( ) : void

Initializes the target.

Write ( LogEventInfo logEvent ) : void

Writes the specified log event to the console highlighting entries and words based on a set of defined rules.

Private Methods

Method Description
ColorizeEscapeSequences ( TextWriter output, string message, ColorPair startingColor, ColorPair defaultColor ) : void
GetMatchingRowHighlightingRule ( LogEventInfo logEvent ) : NLog.Targets.ConsoleRowHighlightingRule
IsColorChange ( ConsoleOutputColor targetColor, ConsoleColor oldColor ) : bool
WriteToOutput ( LogEventInfo logEvent, string message ) : void

Method Details

CloseTarget() protected method

Closes the target and releases any unmanaged resources.
protected CloseTarget ( ) : void
return void

ColoredConsoleTarget() public method

Initializes a new instance of the ColoredConsoleTarget class.
The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message}
public ColoredConsoleTarget ( ) : NLog.Common
return NLog.Common

ColoredConsoleTarget() public method

Initializes a new instance of the ColoredConsoleTarget class.
The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message}
public ColoredConsoleTarget ( string name ) : NLog.Common
name string Name of the target.
return NLog.Common

InitializeTarget() protected method

Initializes the target.
protected InitializeTarget ( ) : void
return void

Write() protected method

Writes the specified log event to the console highlighting entries and words based on a set of defined rules.
protected Write ( LogEventInfo logEvent ) : void
logEvent LogEventInfo Log event.
return void