hmpo-logger
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -37,2 +37,3 @@ var winston = require('winston'), | ||
clientip: 'clientip', | ||
uniqueID: 'x-uniq-id', | ||
remoteAddress: 'connection.remoteAddress', | ||
@@ -85,4 +86,25 @@ hostname: 'hostname', | ||
_.extend(this._options, options); | ||
if (options) { | ||
this._options = _.extend( | ||
{}, | ||
Manager.defaultOptions, | ||
options); | ||
this._options.meta = _.pick( | ||
_.extend( | ||
{}, | ||
Manager.defaultOptions.meta, | ||
options.meta | ||
), | ||
_.isString); | ||
this._options.requestMeta = _.pick( | ||
_.extend( | ||
{}, | ||
Manager.defaultOptions.requestMeta, | ||
options.requestMeta | ||
), | ||
_.isString); | ||
} | ||
winston.addColors(Manager.levelColors); | ||
@@ -89,0 +111,0 @@ |
{ | ||
"name": "hmpo-logger", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Consistent logging for hmpo apps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -73,2 +73,3 @@ # hmpo-logger | ||
clientip: 'clientip', | ||
uniqueID: 'x-uniq-id', | ||
remoteAddress: 'connection.remoteAddress', | ||
@@ -75,0 +76,0 @@ hostname: 'hostname', |
@@ -85,2 +85,19 @@ | ||
it('should augment instead of overwriting configured meta data', function () { | ||
manager.config({ | ||
meta: { | ||
host: undefined, | ||
request: null, | ||
extra: 'extravalue', | ||
verb: false | ||
} | ||
}); | ||
manager._options.meta.should.deep.equal({ | ||
pm: 'env[pm_id]', | ||
sessionID: 'sessionID', | ||
extra: 'extravalue' | ||
}); | ||
}); | ||
}); | ||
@@ -87,0 +104,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37120
843
104