added example for testing

master
David Kebler 2019-01-01 19:42:25 -08:00
parent 7d2be397cd
commit 78e6df7db5
1 changed files with 19 additions and 0 deletions

19
example/example.js Normal file
View File

@ -0,0 +1,19 @@
import logger from '../src/logger'
let log = {}
class LOGTEST {
constructor(opts) {
log = logger({
name: 'test',
id: opts.id,
file: 'example/example.js',
class: 'LOGTEST'
})
}
}
let test = new LOGTEST({id:'process-test1'})
log.info({test:'filter', msg:'this is a logged message'})
log.fatal('this is a fatal logged message')