C# Class NLog.Layouts.SimpleLayout

Inheritance: Layout, ISupportsLazyParameters
Afficher le fichier Open project: NLog/NLog Class Usage Examples

Méthodes publiques

Méthode Description
Escape ( string text ) : string

Escapes the passed text so that it can be used literally in all places where layout is normally expected without being treated as layout.

Escaping is done by replacing all occurrences of '${' with '${literal:text=${}'

Evaluate ( string text ) : string

Evaluates the specified text by expanding all layout renderers in new LogEventInfo context.

Evaluate ( string text, LogEventInfo logEvent ) : string

Evaluates the specified text by expanding all layout renderers.

SimpleLayout ( ) : System.Collections.Generic

Initializes a new instance of the SimpleLayout class.

SimpleLayout ( string txt ) : System.Collections.Generic

Initializes a new instance of the SimpleLayout class.

SimpleLayout ( string txt, ConfigurationItemFactory configurationItemFactory ) : System.Collections.Generic

Initializes a new instance of the SimpleLayout class.

ToString ( ) : string

Returns a that represents the current object.

Méthodes protégées

Méthode Description
GetFormattedMessage ( LogEventInfo logEvent ) : string

Renders the layout for the specified logging event by invoking layout renderers that make up the event.

InitializeLayout ( ) : void

Initializes the layout.

Private Methods

Méthode Description
SetRenderers ( LayoutRenderer renderers, string text ) : void
SimpleLayout ( LayoutRenderer renderers, string text, ConfigurationItemFactory configurationItemFactory ) : System.Collections.Generic

Method Details

Escape() public static méthode

Escapes the passed text so that it can be used literally in all places where layout is normally expected without being treated as layout.
Escaping is done by replacing all occurrences of '${' with '${literal:text=${}'
public static Escape ( string text ) : string
text string The text to be escaped.
Résultat string

Evaluate() public static méthode

Evaluates the specified text by expanding all layout renderers in new LogEventInfo context.
public static Evaluate ( string text ) : string
text string The text to be evaluated.
Résultat string

Evaluate() public static méthode

Evaluates the specified text by expanding all layout renderers.
public static Evaluate ( string text, LogEventInfo logEvent ) : string
text string The text to be evaluated.
logEvent LogEventInfo Log event to be used for evaluation.
Résultat string

GetFormattedMessage() protected méthode

Renders the layout for the specified logging event by invoking layout renderers that make up the event.
protected GetFormattedMessage ( LogEventInfo logEvent ) : string
logEvent LogEventInfo The logging event.
Résultat string

InitializeLayout() protected méthode

Initializes the layout.
protected InitializeLayout ( ) : void
Résultat void

SimpleLayout() public méthode

Initializes a new instance of the SimpleLayout class.
public SimpleLayout ( ) : System.Collections.Generic
Résultat System.Collections.Generic

SimpleLayout() public méthode

Initializes a new instance of the SimpleLayout class.
public SimpleLayout ( string txt ) : System.Collections.Generic
txt string The layout string to parse.
Résultat System.Collections.Generic

SimpleLayout() public méthode

Initializes a new instance of the SimpleLayout class.
public SimpleLayout ( string txt, ConfigurationItemFactory configurationItemFactory ) : System.Collections.Generic
txt string The layout string to parse.
configurationItemFactory NLog.Config.ConfigurationItemFactory The NLog factories to use when creating references to layout renderers.
Résultat System.Collections.Generic

ToString() public méthode

Returns a that represents the current object.
public ToString ( ) : string
Résultat string