micro-log

micro logger library

npm install micro-log
1 downloads in the last week
16 downloads in the last month

micro-log.js

micro logger library for both browsers and node.js

SYNOPSYS

log.setLevel('info');

log.warn('foobar'); // output to console.log by default
log.info('foobar');
log.debug('aaaaaa'); // does not ouput

Send JavaScript errors to server:

log.LOG = function (message) {
    var img = new Image();
    img.src = '/api/report_js_error?' +
        '&loc=' + encodeURIComponent(location.href) +
        '&msg=' + encodeURIComponent(message);
};
npm loves you