-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace bunyan with more stable, zero-dependency logger.
- Loading branch information
1 parent
8af0e4c
commit 5624306
Showing
3 changed files
with
17 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
const bunyan = require('bunyan') | ||
const logger = require('diary') | ||
const packagejson = require('../package.json') | ||
const assert = require('assert') | ||
|
||
const newLogger = name => { | ||
assert(name, 'Name must be defined') | ||
return bunyan.createLogger({ | ||
name: name, | ||
app: packagejson.name, | ||
src: process.env.NODE_ENV === 'development' | ||
}) | ||
return logger.diary(`${packagejson.name}: ${name}`) | ||
} | ||
|
||
module.exports = newLogger |
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