Skip to content

DanielSchaffer/debug-wrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

debug-wrap

A wrapper around the JavaScript console object.

debug-wrap allows you to use all of the console object's features without worrying about browser support. It also allows you to automatically prepend a tag to all console entries, making it easier to identify the source module.

Usage

require(['debug-wrap'], function myModule(debugWrap) {
    var debug = debugWrap('myModule'),
        myObj = {},
        value;
        
    debug('here is my module');
    
    debug('attempting to access property');
    try {
        value = myObj.foo.bar;
    } catch (ex) {
        debug.error('unable to access property', ex);
    }
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published