-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logger)!: remove mandatory use of node-config
- Loading branch information
Showing
8 changed files
with
38 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
const test = require('ava') | ||
const log = require('..').logger | ||
const Logger = require('..') | ||
|
||
const config = require('../config/test.json') | ||
|
||
const log = new Logger(config).get() | ||
|
||
test('test basic', (t) => { | ||
log.trace('toto') | ||
log.debug('toto') | ||
log.info('toto') | ||
log.warn('toto') | ||
log.error('toto') | ||
log.fatal('toto') | ||
log.trace('trace') | ||
log.debug('debug') | ||
log.info('info') | ||
log.warn('warn') | ||
log.error('error') | ||
log.fatal('fatal') | ||
|
||
t.pass() | ||
}) | ||
|
||
test('test child', (t) => { | ||
const childLog = log.child({ child: 'childLog' }) | ||
|
||
childLog.trace('msg child') | ||
childLog.debug('msg child') | ||
childLog.info('msg child') | ||
childLog.warn('msg child') | ||
childLog.error('msg child') | ||
childLog.fatal('msg child') | ||
childLog.trace('trace child') | ||
childLog.debug('debug child') | ||
childLog.info('info child') | ||
childLog.warn('warn child') | ||
childLog.error('error child') | ||
childLog.fatal('fatal child') | ||
|
||
t.pass() | ||
}) |