Base class for all appenders

Instance Properties
PropertyTypeDefault ValueDescription
levelcomb.logging.Level

the level of this Appender.

nameString

the name of this Appender.

patternString

the pattern for this Appender.

Constructor

Defined logging/appenders/appender.js

createAppender Static Function Public


Defined logging/appenders/appender.js

Acts as a factory for appenders.

Example
var logging = comb.logging,
    Logger = logging.Logger,
    Appender = logging.appenders.Appender;

var logger = comb.logging.Logger.getLogger("my.logger");
logger.addAppender(Appender.createAppender("consoleAppender"));
        
Arguments Returns Source
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!");
   }
           
}
    

registerType Static Function Public


Defined logging/appenders/appender.js

Register an appender so it can be used with comb.logging.PropertyConfigurator

Example
var Appender = comb.logging.appenders.Appender;
comb.define(Appender, {
     instance : {
         append : function(event){
             //log the message
         }
     }
}).registerType("MyAppender").as(module);
        
Arguments Returns Source
function (type){
   if (base.isString(type)) {
       APPENDER_TYPES[type.toLowerCase()] = this;
   }
   return this;
           
}
    

append Function Public


Defined logging/appenders/appender.js

Appends a message to a log. This method is abstract and must be implemented in subclasses

Arguments Source
function (event){
   throw new Error("abstract method");
           
}
    

License

MIT https://github.com/C2FO/comb/raw/master/LICENSE

Meta