forked from godaddy/slay-log
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (18 loc) · 702 Bytes
/
index.js
File metadata and controls
23 lines (18 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* eslint no-process-env: 0, max-statements: [2, 20] */
'use strict';
var merge = require('lodash.merge');
var debug = require('diagnostics')('slay-log');
module.exports = function (defaults) {
debug('scheduling with defaults { %j }', Object.keys(defaults || {}).join(', '));
return function (app, options, done) {
debug('execute `app.log.configure`');
//
// Merge the defaults passed to the preboot, and any `options.config`
// passed to `app.start`.
//
var opts = options.log || options.logger || app.config.get('log') || app.config.get('logger') || {};
app.log.configure(merge({}, defaults, opts));
debug('executed `app.log.configure`');
done();
};
};