-
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.
Fixes linting error, allows for merged options in transport functions…
…, and fixes wrong prop name in hasTransport
- Loading branch information
Showing
2 changed files
with
23 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
Space.Module.define('Space.logging.Winston', { | ||
Space.Module.define('Space.logging.Winston', { | ||
|
||
dependencies: { | ||
configuration: 'configuration', | ||
log: 'Space.Logger', | ||
log: 'Space.Logger' | ||
}, | ||
|
||
onInitialize() { | ||
let log = this.injector.get('log'); | ||
const log = this.injector.get('log'); | ||
|
||
let transports = lodash.get(this.configuration, 'log.winston.transports', [ | ||
const transports = lodash.get(this.configuration, 'log.winston.transports', [ | ||
this._setupWinstonConsoleTransport() | ||
]) | ||
let adapter = new Space.Logger.WinstonAdapter(transports); | ||
]); | ||
const adapter = new Space.Logger.WinstonAdapter(transports); | ||
this.injector.map('Space.Logger.WinstonAdapter').toStaticValue(adapter); | ||
log.addAdapter('winston', adapter); | ||
}, | ||
|
||
_setupWinstonConsoleTransport() { | ||
options = { | ||
_setupWinstonConsoleTransport(options) { | ||
const mergedOptions = _.extend({}, { | ||
colorize: true, | ||
prettyPrint: true, | ||
level: 'info', | ||
} | ||
return Space.Logger.WinstonAdapter.console(options); | ||
level: 'info' | ||
}, options); | ||
return Space.Logger.WinstonAdapter.console(mergedOptions); | ||
} | ||
}); | ||
}); |
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