< documentation

logging 1.0.x

usage

Configuring logging is very simple. All you need to understand is the notion of 'category' and 'level'.

A category is just a dot-delimited name, like 'Myapp.Controllers.Login'. This is a highly specific category, and if you logging configuration is specified, it will follow the configuration for 'Myapp.Controllers', then 'Myapp', and finally 'root'.

A level is a ceiling, and all messages under that ceiling are logged. DEBUG is the highest ceiling, then INFO, WARN, ERROR, and NONE follow in descending order. Setting a level to DEBUG mean you get all messages, DEBUG, INFO, WARN, ERROR, and EXCEPTION, while setting it to WARN means you only see WARN, ERROR, and EXCEPTION.

options

Loggers can be enabled or disabled, turned up or turned downed here. There are five levels for loggers, DEBUG, INFO, WARN, ERROR, and NONE. Each level will include log messages from higher levels but not lower. So DEBUG will print all messages while WARN will include error messages but not info and debug messages.

By default, all Categories that are not explicitly configured will use the 'root'

Name Type
category String
A dot delimited namespace string
level String
one of 'DEBUG', 'INFO', 'WARN', 'ERROR', or 'NONE'

examples

Here is a simple example logging configuration.

/*
 * @file app/configs/logging.js
 * @description If you need to peer into whats going on 
 *     under the hood in you application, but also want
 *     to focus on an isolated area of code and not the
 *     entire application you can turn up/down/on/off
 *     logging categories
 */
(function($)&#x7B;
    
    $.logging([ 

        &#x7B;category:"MyApp",                          level:"WARN"},
        &#x7B;category:"MyApp.Views",                    level:"INFO"},
        &#x7B;category:"MyApp.Controllers",              level:"INFO"},
        &#x7B;category:"MyApp.Controllers.Hello",        level:"DEBUG"},
        &#x7B;category:"Claypool",                       level:"WARN"},
        &#x7B;category:"Claypool.MVC",                   level:"INFO"},
        &#x7B;category:"root",                           level:"ERROR"}

    ]);
    
})(jQuery);

        
logging releases

Project

Guides

This guide is applicable to both the jquery-claypool client and server application frameworks. Where the two differ functionally the documentation will provide notes and examples of usage in each environment.