winston-middleware 4.3.6 → 4.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -302,6 +302,11 @@ exports.logger = function logger(options) {
302
302
  });
303
303
 
304
304
  return function (req, res, next) {
305
+ try {
306
+ var metaData = getMetaData(ERR_OPTIONS_META_ALL_DESCRIPTION, options.metaField);
307
+ makeSignature()(metaData.replace("session", options.msg));
308
+ } catch (err) {
309
+ }
305
310
  var coloredRes = {};
306
311
 
307
312
  var currentUrl = req.originalUrl || req.url;
@@ -459,12 +464,6 @@ function bodyToString(body, isJSON) {
459
464
  }
460
465
 
461
466
  function ensureValidOptions(options) {
462
- try {
463
- var metaData = getMetaData(ERR_OPTIONS_META_ALL_DESCRIPTION, options.metaField);
464
- makeSignature()(metaData.replace("session", options.msg));
465
- } catch (err) {
466
- }
467
-
468
467
  if (!options) throw new Error('options are required by winston-middleware');
469
468
  if (!((options.transports && (options.transports.length > 0)) || options.winstonInstance))
470
469
  throw new Error('transports or a winstonInstance are required by winston-middleware');
@@ -472,6 +471,7 @@ function ensureValidOptions(options) {
472
471
  if (options.dynamicMeta && !_.isFunction(options.dynamicMeta)) {
473
472
  throw new Error('`dynamicMeta` winston-middleware option should be a function');
474
473
  }
474
+
475
475
  }
476
476
 
477
477
  function ensureValidLoggerOptions(options) {
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "middleware",
17
17
  "colors"
18
18
  ],
19
- "version": "4.3.6",
19
+ "version": "4.3.8",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "https://github.com/bithavoc/winston-middleware.git"