-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.js
46 lines (35 loc) · 1.11 KB
/
sample.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
39
40
41
42
43
44
45
46
var log = require('./src/carpet')
require('colors')
console.log(log)
log.log('hello world, this is a simple log')
log.debug('debug level')
log.info('lots of info here')
log.warn('all your warn are belong to us')
log.error('there was an error while displaying the previous error')
log.log("loook ma' %s formatted output !!!%doneoneeleven", 'this is'.red, 1)
log.log('next one is empty')
log.log()
log.log('objects: ', { a: 2, b: ['a', 's', undefined, 'f'], c: { b: { a: 2 } } })
log.e({ a: 2, b: ['a', 's', undefined, 'f'], c: { b: { a: 2 } } }, 'objects first ')
log('calling it short')
log.w('calling a short warning')
log.setLevel('warn') // only warnings or errors should now be logged
log(log.getLevel())
log.w('this goes')
log.e('this also goes')
log("this should not go..if you see this in the output then there's a bug")
log.setLevel(0) // log everything (default);
log(log.getLevel())
log('hell yeah')
log.d('this is visible')
log.i('this is also visible')
log.e('amen')
log.setLevel('nothing')
log('invisible')
// log nothing
log.setLevel('-1')
log('invisible')
// log everything
log.setLevel()
log.w('no way')
log('')