C# Class NLog.Targets.ColoredConsoleTarget

Inheritance: NLog.Targets.TargetWithLayoutHeaderAndFooter
Afficher le fichier Open project: NLog/NLog Class Usage Examples

Private Properties

Свойство Type Description
ColorizeEscapeSequences void
GetMatchingRowHighlightingRule NLog.Targets.ConsoleRowHighlightingRule
IsColorChange bool
WriteToOutput void

Méthodes publiques

Méthode 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}

Méthodes protégées

Méthode 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

Méthode 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 méthode

Closes the target and releases any unmanaged resources.
protected CloseTarget ( ) : void
Résultat void

ColoredConsoleTarget() public méthode

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
Résultat NLog.Common

ColoredConsoleTarget() public méthode

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.
Résultat NLog.Common

InitializeTarget() protected méthode

Initializes the target.
protected InitializeTarget ( ) : void
Résultat void

Write() protected méthode

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.
Résultat void