UNPKG

862 BJavaScriptView Raw
1"use strict";
2var logger = require('..').console( {
3 // format: "{timestamp: '{{timestamp}}', title: '{{title}}', file: '{{file}}', line:'{{line}}', method: '{{method}}', message: '{{message}}' }"
4 transport : function(data) {
5 //if you dont need JSON.stringify, just remove it
6 console.log(JSON.stringify({
7 timestamp: data.timestamp,
8 title: data.title,
9 file: data.file,
10 line: data.line,
11 method: data.method,
12 message: data.message
13 }));
14 }
15 });
16logger.log('hello');
17logger.trace('hello', 'world');
18logger.debug('hello %s', 'world', 123);
19logger.info('hello %s %d', 'world', 123, {foo:'bar'});
20logger.warn('hello %s %d %j', 'world', 123, {foo:'bar'});
21logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object);
22
23eval("logger.log('hello');");