-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
38 lines (33 loc) · 1.1 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var path = require('path');
var filename = path.basename(path.normalize(__filename))
var lumberjack = require('./index.js')
function test() {
var log = lumberjack.getLogger(filename, 'trace');
log.info("Line 1");
log.warn("Line %s", 2);
log.debug("%srd line", 3);
log.error("4th Line comes here");
log.trace("Trac%s on the %sth line", "ing", 5);
try {
log.debug("Insuffici%sent parameters passed");
} catch(ex) {
log.error("%s", String(ex));
}
function CtorName() {
this.functionName = function() {
log.trace("You should see the object & function name on this line");
}
this.otherProc = function notSameAsMemberName() {
log.trace("You should see the object & function name on this line too");
}
}
var x = new CtorName();
x.functionName();
x.otherProc();
lumberjack.setGlobalLogLevel('debug');
log = lumberjack.getLogger(filename, 'info');
// console.log("Current Log Level:", log.getLevel());
log.trace("Should NOT print this");
log.info("Should print this");
}
test();