C# Class NLog.Layouts.SimpleLayout

Inheritance: Layout, ISupportsLazyParameters
Exibir arquivo Open project: NLog/NLog Class Usage Examples

Public Methods

Method 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.

Protected Methods

Method 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

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

Method Details

Escape() public static method

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.
return string

Evaluate() public static method

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.
return string

Evaluate() public static method

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.
return string

GetFormattedMessage() protected method

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.
return string

InitializeLayout() protected method

Initializes the layout.
protected InitializeLayout ( ) : void
return void

SimpleLayout() public method

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

SimpleLayout() public method

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

SimpleLayout() public method

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.
return System.Collections.Generic

ToString() public method

Returns a that represents the current object.
public ToString ( ) : string
return string