Base class for all appenders
Instance PropertiesProperty | Type | Default Value | Description |
level | comb.logging.Level | the level of this Appender. | |
name | String | the name of this Appender. | |
pattern | String | the pattern for this Appender. | |
Acts as a factory for appenders.
Examplevar logging = comb.logging, Logger = logging.Logger, Appender = logging.appenders.Appender; var logger = comb.logging.Logger.getLogger("my.logger"); logger.addAppender(Appender.createAppender("consoleAppender"));Arguments
the type of appender to create.
{}
] : additional options to pass to the appender.
comb.logging.appenders.Appender
an appender to add to a logger.
function (type,options){ var caseType = type.toLowerCase(); if (caseType in APPENDER_TYPES) { return new APPENDER_TYPES[caseType](options); } else { throw new Error(type + " appender is not registered!"); } }
Register an appender so it can be used with comb.logging.PropertyConfigurator
Examplevar Appender = comb.logging.appenders.Appender; comb.define(Appender, { instance : { append : function(event){ //log the message } } }).registerType("MyAppender").as(module);Arguments
the identifier for your appender type.
returns the Appender class for chaining.
function (type){ if (base.isString(type)) { APPENDER_TYPES[type.toLowerCase()] = this; } return this; }
Appends a message to a log. This method is abstract and must be implemented in subclasses
Argumentsthe logging event to log.
Date
: the timeStamp of the event.
comb.logging.Level
: the level of the event.
String
: the name of the logger the event was emitted from.
String
: the message that is being logged.
function (event){ throw new Error("abstract method"); }
MIT https://github.com/C2FO/comb/raw/master/LICENSE
git clone git://github.com/C2FO/comb.git