Class Index | File Index

## Classes

- _global_
- comb
- comb.array
- comb.characters
- comb.collections
- comb.collections.AnderssonTree
- comb.collections.AVLTree
- comb.collections.BinaryTree
- comb.collections.Collection
- comb.collections.HashTable
- comb.collections.Heap
- comb.collections.Iterable
- comb.collections.MaxHeap
- comb.collections.MinHeap
- comb.collections.Pool
- comb.collections.PriorityQueue
- comb.collections.Queue
- comb.collections.RedBlackTree
- comb.collections.Stack
- comb.collections.Tree
- comb.date
- comb.logging
- comb.logging.appenders
- comb.logging.appenders.Appender
- comb.logging.appenders.ConsoleAppender
- comb.logging.appenders.FileAppender
- comb.logging.appenders.JSONAppender
- comb.logging.appenders.RollingFileAppender
- comb.logging.BasicConfigurator
- comb.logging.Level
- comb.logging.Logger
- comb.logging.PropertyConfigurator
- comb.number
- comb.plugins
- comb.plugins.Broadcaster
- comb.plugins.Middleware
- comb.Promise
- comb.PromiseList
- comb.regexp
- comb.string

# Class comb.logging.Logger

This class is the entry point for all logging actions in comb.

Logger should be retrieved by calling Logger.getLogger() NOT through the new keyword

All loggers in comb follow a heirarchy of inheritance based on a dot notation.

                             rootLogger - ""
                                     /         \
                                  "my"      "myOther"
                                  /               \
                            "my.logger"       "myOther.logger"
                               /                     \
                          "my.logger.Log"        "myOther.logger.Log"

In the above Tree the rootLogger is the base for all logger. my and myOther inherit from rootLogger my.logger inherits from my, and myOther.logger inherits from myOther. The logs do not have to be retrieved in order. If I set rootLogger to ERROR level and added a console appender to it the appender and level will be added to all logs. However if I set my to INFO level and add a fileAppender to it the level and appender will only be added to logs in "my" subtree. If you set my.logger to not be additive then levels, and appenders will not propogate down to the rest of the tree.

For information on levels see comb.logging.Level.

For information on appenders see

- comb.logging.appenders.Appender
- comb.logging.appenders.ConsoleAppender
- comb.logging.appenders.FileAppender
- comb.logging.appenders.JSONAppender
- comb.logging.appenders.RollingFileAppender

For information on configurators see comb.logging.BasicConfigurator or comb.logging.PropertyConfigurator.

Defined in: index.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| comb.logging.Logger()

Field Summary
Field Attributes | Field Name and Description
--- | ---
| additive set to false to prevent changes to this logger from propogating down.
| appenders list of appenders this logger currently contains.
| fullName the full path name of this Logger.
| isDebug true if this Loggers level is DEBUG
| isError true if this Loggers level is ERROR
| isFatal true if this Loggers level is FATAL
| isInfo true if this Loggers level is INFO
| isOff true if this Loggers level is OFF
| isTrace true if this Loggers level is TRACE
| isWarn true if this Loggers level is WARN
| level the level of this Logger
| name the name of this logger this does not include the dot notated name
| subLoggers all loggers this logger is the parent of.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| addAppender(appender) Add an appender to this logger.
| addAppenders(appenders) Short cut to add a list of appenders to this Logger
| debug(message) Log an debug level message
| error(message) Log an error level message
| fatal(message) Log an fatal level message
| getAppender(name) Gets an appender from this logger
<static> | comb.logging.Logger.getLogger(name) Retrieves/Creates a logger based on the name passed in
<static> | comb.logging.Logger.getRootLogger() Return the root of all loggers
| info(message) Log an info level message
| isAppenderAttached(name) Determines if an appender is attached.
| log(level, message) Log a message
| removeAllAppenders() Removes all appenders from this logger and sub loggers if this Logger is additive.
| removeAppender(name) Removes and appender from this logger.
| removeAppenders(appenders) Removes a list of appenders from this logger.
| trace(message) Log an trace level message
| warn(message) Log an warn level message

Class Detail
comb.logging.Logger()

    var logging = comb.logging,
        Logger = logging.Logger,
        appenders = logging.appenders,
        Level = logging.Level;

    //configure you logging environement

    var bc = logging.BasicConfigurator();
    //add console appender to all loggers
    bc.configure();
    //add a file appender to all loggers
    bc.configure(new appenders.FileAppender({file : "/var/log/myLog.log"}));

    //Retreiving a logger.
    var combLogger = Logger.getLogger("comb");
    var combCollectionLogger = Logger.getLogger("comb.collections");
    var treeLogger = Logger.getLogger("comb.collections.Tree");

    //set my treeLogger to DEBUG Level
    treeLogger.level = Level.DEBUG;
    //add a JSON appender to tree logger just for fun!
    treeLogger.addAppender(new appenders.JSONAppender({file : "/var/log/myTreeLogger.json"}));

    //NOW USE THEM

Field Detail
{Boolean} additive
set to false to prevent changes to this logger from propogating down.

{comb.logging.appenders.Appender} appenders
list of appenders this logger currently contains.

{String} fullName
the full path name of this Logger.

{Boolean} isDebug
true if this Loggers level is DEBUG

{Boolean} isError
true if this Loggers level is ERROR

{Boolean} isFatal
true if this Loggers level is FATAL

{Boolean} isInfo
true if this Loggers level is INFO

{Boolean} isOff
true if this Loggers level is OFF

{Boolean} isTrace
true if this Loggers level is TRACE

{Boolean} isWarn
true if this Loggers level is WARN

{comb.logging.Level} level
the level of this Logger

{String} name
the name of this logger this does not include the dot notated name

{Array<comb.logging.Logger>} subLoggers
all loggers this logger is the parent of.
Method Detail
addAppender(appender)
Add an appender to this logger. If this is additive then the appender is added to all subloggers.

Parameters:
{comb.logging.Appender} appender
  the appender to add.

addAppenders(appenders)
Short cut to add a list of appenders to this Logger

Parameters:
{Array<comb.logging.Appender>} appenders

debug(message)
Log an debug level message

Parameters:
{String} message
  the message to log.

error(message)
Log an error level message

Parameters:
{String} message
  the message to log.

fatal(message)
Log an fatal level message

Parameters:
{String} message
  the message to log.

{comb.logging.Appender|undefined} getAppender(name)
Gets an appender from this logger

Parameters:
{String} name
  the name of the appender.

Returns:
  {comb.logging.Appender|undefined} returns the appender with the specified name or undefined if it is not found.

<static> comb.logging.Logger.getLogger(name)
Retrieves/Creates a logger based on the name passed in

Parameters:
{String} name
  the name of the logger

<static> comb.logging.Logger.getRootLogger()
Return the root of all loggers

info(message)
Log an info level message

Parameters:
{String} message
  the message to log.

isAppenderAttached(name)
Determines if an appender is attached.

Parameters:
{String} name
  the name of the appender.

log(level, message)
Log a message

Parameters:
{comb.logging.Level} level
  the level the message is
{String} message
  the message to log.

removeAllAppenders()
Removes all appenders from this logger and sub loggers if this Logger is additive.

removeAppender(name)
Removes and appender from this logger.

Parameters:
{String} name
  the name of the appender

removeAppenders(appenders)
Removes a list of appenders from this logger.

Parameters:
{Array<String>} appenders
  a list of names of appenders to remove

trace(message)
Log an trace level message

Parameters:
{String} message
  the message to log.

warn(message)
Log an warn level message

Parameters:
{String} message
  the message to log.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 25 2011 13:20:07 GMT-0500 (CDT)