Class: LineFormattedTarget

system.logging.targets. LineFormattedTarget


new LineFormattedTarget(init)

All logger target implementations that have a formatted line style output should extend this class. It provides default behavior for including date, time, channel, and level within the output.

Parameters:
Name Type Description
init Object

A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.

Extends

Members


factory :system.logging.LoggerFactory

Determinates the LoggerFactory reference of the target, by default the target use the system.logging.Log singleton.

Type:
Inherited From:

filters

Determinates the filters array representation of the target.

Inherited From:

includeChannel :boolean

Indicates if the channel for this target should added to the trace.

Type:
  • boolean
Default Value:
  • false

includeDate :boolean

Indicates if the date should be added to the trace.

Type:
  • boolean
Default Value:
  • false

includeLevel :boolean

Indicates if the level for the event should added to the trace.

Type:
  • boolean
Default Value:
  • false

includeLines :boolean

Indicates if the line for the event should added to the trace.

Type:
  • boolean
Default Value:
  • false

includeMilliseconds :boolean

Indicates if the milliseconds should be added to the trace. Only relevant when includeTime is true.

Type:
  • boolean
Default Value:
  • false

includeTime :boolean

Indicates if the time should be added to the trace.

Type:
  • boolean
Default Value:
  • false

level

Determinates the level (LoggerLevel of this target.

Inherited From:

separator :string

The separator string.

Type:
  • string

Methods


addFilter(channel)

Inserts a channel in the fllters if this channel don't exist.

Parameters:
Name Type Description
channel string

The channel to rgister.

Inherited From:
Returns:

true if the channel is add in the list.


addLogger(logger)

Sets up this target with the specified logger. Note : this method is called by the framework and should not be called by the developer.

Parameters:
Name Type Description
logger system.logging.Logger

The logger to register.

Inherited From:

<protected> formatDate()

This method format the passed Date in arguments.


<protected> formatLevel()

This method format the passed level in arguments.


<protected> formatLines()

This method format the current line value.


<protected> formatMessage()

This method format the log message.


<protected> formatTime()

This method format the current Date passed in argument.


<protected> getDigit()

Returns the string representation of a number and use digit conversion.

Returns:

the string representation of a number and use digit conversion.


internalLog(message, level)

Descendants of this class should override this method to direct the specified message to the desired output.

Parameters:
Name Type Description
message string

String containing preprocessed log message which may include time, date, channel, etc. based on property settings, such as includeDate, includeChannel, etc.

level system.logging.LoggerLevel

The level of the log message.


logEntry()

This method receive a LoggerEntry from an associated logger. A target uses this method to translate the event into the appropriate format for transmission, storage, or display. This method will be called only if the event's level is in range of the target's level. Descendants need to override this method to make it useful.

Overrides:

removeFilter(channel)

Removes a channel in the fllters collection if this channel exist.

Parameters:
Name Type Description
channel string

The channel to unregister.

Inherited From:
Returns:

true if the channel is removed.


removeLogger()

Stops this target from receiving events from the specified logger.

Inherited From:

resetLineNumber()

Resets the internal line number value (set to 1).


toString()

Returns the String representation of the object.

Overrides:
Returns:

the String representation of the object.