Class org.as2lib.env.log.stringifier.PatternLogMessageStringifier

org.as2lib.core.BasicClass
   +--org.as2lib.env.log.stringifier.PatternLogMessageStringifier

Implemented Interfaces

Stringifier

Description

PatternLogMessageStringifier stringifies LogMessage instances based on configuration and a pattern.

Method Index

new PatternLogMessageStringifier()

execute()

Inherited from BasicClass

toString()

Constructor Detail

PatternLogMessageStringifier

public function PatternLogMessageStringifier(showLevel:Boolean, showLoggerName:Boolean, timeFormat:String)

Constructs a new PatternLogMessageStringifier instance.

Level and logger name are shown by default.

If timeFormat is not passed-in or is null the date-time is not shown in the log message.

Parameters

showLeveldetermines whether to show levels in the string representation
timeFormat(optional) the time format pattern used to format the time stamp

Method Detail

execute

public function execute(target):String

Returns the string representation of the passed-in LogMessage instance.

The returned string is composed as follows:

   theTime  theLogLevel  theLoggerName - theMessage
 

Depending on your custom settings, which information to show and which not, a few parts may be left out.

Parameters

targetthe LogMessage instance to stringify

Return

the string representation of the passed-in target

Specified By

execute() in org.as2lib.util.Stringifier