Class: FunctionAppender

FunctionAppender

FunctionAppender extends SimpleLogAppender and implements the publishing of log messages by invocation of a custom function.

new FunctionAppender(levelopt, categoryopt, functionToCall, objectToApplyToopt)

Constructor for FunctionAppender.
Parameters:
Name Type Argument Description
level String <optional>
The threshold level at which the SimpleLogAppender is created. It should be one of "DEBUG", "INFO", "WARN", "ERROR" and "FATAL". If not or wrongly specified INFO is assumed.
category String <optional>
The category this appender should listen to. If not specified the appender will get log for every available category. See SimpleLogAppender#setCategoryFilter.
functionToCall function a well defined function to call passing log messages. The function will be invoked with a single String argument. If a more detailed insight on the message details is required it is suggested to implement a custom SimpleLogAppender.
objectToApplyTo Object <optional>
an instance of object to apply the functionToCall to.

Extends

  • SimpleLogAppender

Method Summary

log
Publish a log message by calling the specified function.

Method Detail

log(category, level, mex, header)

Publish a log message by calling the specified function.
Parameters:
Name Type Description
category String the logger category that produced the given message.
level String the logging level of the given message. It should be one of DEBUG INFO WARN ERROR FATAL.
mex String the message to be logged. It could be a String instance, an Error instance or any other object, provided that it has a toString method.
header String a header for the message