@contrast/agent 4.16.2 → 4.18.0
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.
- package/esm.mjs +21 -11
- package/lib/assess/policy/propagators.json +4 -0
- package/lib/assess/policy/signatures.json +5 -0
- package/lib/assess/propagators/fastify-static/allowed-path.js +85 -0
- package/lib/assess/sources/index.js +26 -5
- package/lib/cli-rewriter/index.js +1 -1
- package/lib/contrast.js +1 -1
- package/lib/core/config/options.js +14 -1
- package/lib/core/config/util.js +39 -11
- package/lib/core/rewrite/index.js +2 -2
- package/lib/protect/service.js +2 -0
- package/lib/util/trace-util.js +5 -4
- package/node_modules/@colors/colors/LICENSE +26 -0
- package/node_modules/@colors/colors/README.md +219 -0
- package/node_modules/@colors/colors/examples/normal-usage.js +83 -0
- package/node_modules/@colors/colors/examples/safe-string.js +80 -0
- package/node_modules/@colors/colors/index.d.ts +136 -0
- package/node_modules/@colors/colors/lib/colors.js +211 -0
- package/node_modules/@colors/colors/lib/custom/trap.js +46 -0
- package/node_modules/@colors/colors/lib/custom/zalgo.js +110 -0
- package/node_modules/@colors/colors/lib/extendStringPrototype.js +110 -0
- package/node_modules/@colors/colors/lib/index.js +13 -0
- package/node_modules/@colors/colors/lib/maps/america.js +10 -0
- package/node_modules/@colors/colors/lib/maps/rainbow.js +12 -0
- package/node_modules/@colors/colors/lib/maps/random.js +11 -0
- package/node_modules/@colors/colors/lib/maps/zebra.js +5 -0
- package/node_modules/@colors/colors/lib/styles.js +95 -0
- package/node_modules/@colors/colors/lib/system/has-flag.js +35 -0
- package/node_modules/@colors/colors/lib/system/supports-colors.js +151 -0
- package/node_modules/@colors/colors/package.json +49 -0
- package/node_modules/@colors/colors/safe.d.ts +48 -0
- package/node_modules/@colors/colors/safe.js +10 -0
- package/node_modules/@colors/colors/themes/generic-logging.js +12 -0
- package/node_modules/@dabh/diagnostics/README.md +16 -16
- package/node_modules/@dabh/diagnostics/package.json +9 -9
- package/node_modules/color/README.md +9 -0
- package/node_modules/color/index.js +4 -1
- package/node_modules/color/package.json +8 -8
- package/node_modules/color-string/README.md +6 -2
- package/node_modules/color-string/index.js +21 -13
- package/node_modules/color-string/package.json +4 -4
- package/node_modules/colorspace/package.json +5 -5
- package/node_modules/fecha/dist/fecha.min.js +1 -1
- package/node_modules/fecha/dist/fecha.min.js.map +1 -0
- package/node_modules/fecha/lib/fecha.d.ts +2 -2
- package/node_modules/fecha/lib/fecha.js +35 -18
- package/node_modules/fecha/lib/fecha.js.map +1 -0
- package/node_modules/fecha/lib/fecha.umd.js +35 -18
- package/node_modules/fecha/lib/fecha.umd.js.map +1 -0
- package/node_modules/fecha/package.json +9 -10
- package/node_modules/fecha/src/fecha.ts +524 -0
- package/node_modules/logform/.eslintrc +1 -1
- package/node_modules/logform/CHANGELOG.md +24 -0
- package/node_modules/logform/README.md +15 -17
- package/node_modules/logform/browser.js +3 -1
- package/node_modules/logform/cli.js +1 -1
- package/node_modules/logform/colorize.js +2 -2
- package/node_modules/logform/dist/browser.js +8 -2
- package/node_modules/logform/dist/cli.js +2 -2
- package/node_modules/logform/dist/colorize.js +5 -5
- package/node_modules/logform/dist/errors.js +1 -1
- package/node_modules/logform/dist/format.js +9 -5
- package/node_modules/logform/dist/index.js +53 -20
- package/node_modules/logform/dist/json.js +7 -6
- package/node_modules/logform/dist/logstash.js +1 -1
- package/node_modules/logform/dist/pad-levels.js +4 -4
- package/node_modules/logform/dist/printf.js +1 -1
- package/node_modules/logform/dist/simple.js +1 -1
- package/node_modules/logform/dist/splat.js +2 -2
- package/node_modules/logform/dist/uncolorize.js +1 -1
- package/node_modules/logform/errors.js +1 -1
- package/node_modules/logform/index.d.ts +36 -0
- package/node_modules/logform/index.js +19 -20
- package/node_modules/logform/json.js +7 -7
- package/node_modules/logform/logstash.js +1 -1
- package/node_modules/logform/package.json +10 -9
- package/node_modules/logform/simple.js +1 -1
- package/node_modules/logform/uncolorize.js +1 -1
- package/node_modules/safe-stable-stringify/CHANGELOG.md +75 -0
- package/node_modules/safe-stable-stringify/LICENSE +21 -0
- package/node_modules/safe-stable-stringify/esm/package.json +4 -0
- package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
- package/node_modules/safe-stable-stringify/index.d.ts +18 -0
- package/node_modules/safe-stable-stringify/index.js +618 -0
- package/node_modules/safe-stable-stringify/package.json +69 -0
- package/node_modules/safe-stable-stringify/readme.md +170 -0
- package/node_modules/safe-stable-stringify/tsconfig.json +22 -0
- package/node_modules/winston/LICENSE +18 -18
- package/node_modules/winston/README.md +1231 -1230
- package/node_modules/winston/dist/winston/common.js +10 -10
- package/node_modules/winston/dist/winston/config/index.js +17 -17
- package/node_modules/winston/dist/winston/container.js +46 -46
- package/node_modules/winston/dist/winston/create-logger.js +28 -24
- package/node_modules/winston/dist/winston/exception-handler.js +49 -49
- package/node_modules/winston/dist/winston/exception-stream.js +27 -27
- package/node_modules/winston/dist/winston/logger.js +152 -138
- package/node_modules/winston/dist/winston/profiler.js +22 -22
- package/node_modules/winston/dist/winston/rejection-handler.js +54 -54
- package/node_modules/winston/dist/winston/tail-file.js +14 -14
- package/node_modules/winston/dist/winston/transports/console.js +31 -31
- package/node_modules/winston/dist/winston/transports/file.js +101 -101
- package/node_modules/winston/dist/winston/transports/http.js +119 -41
- package/node_modules/winston/dist/winston/transports/index.js +17 -17
- package/node_modules/winston/dist/winston/transports/stream.js +24 -24
- package/node_modules/winston/dist/winston.js +91 -97
- package/node_modules/winston/index.d.ts +213 -193
- package/node_modules/winston/lib/winston/common.js +61 -61
- package/node_modules/winston/lib/winston/config/index.d.ts +99 -98
- package/node_modules/winston/lib/winston/config/index.js +35 -35
- package/node_modules/winston/lib/winston/container.js +114 -114
- package/node_modules/winston/lib/winston/create-logger.js +104 -104
- package/node_modules/winston/lib/winston/exception-handler.js +245 -245
- package/node_modules/winston/lib/winston/exception-stream.js +54 -54
- package/node_modules/winston/lib/winston/logger.js +676 -667
- package/node_modules/winston/lib/winston/profiler.js +51 -51
- package/node_modules/winston/lib/winston/rejection-handler.js +251 -251
- package/node_modules/winston/lib/winston/tail-file.js +124 -124
- package/node_modules/winston/lib/winston/transports/console.js +117 -117
- package/node_modules/winston/lib/winston/transports/file.js +695 -695
- package/node_modules/winston/lib/winston/transports/http.js +267 -202
- package/node_modules/winston/lib/winston/transports/index.d.ts +103 -100
- package/node_modules/winston/lib/winston/transports/index.js +56 -56
- package/node_modules/winston/lib/winston/transports/stream.js +63 -63
- package/node_modules/winston/lib/winston.js +176 -182
- package/node_modules/winston/node_modules/winston-transport/.babelrc +3 -0
- package/node_modules/winston/node_modules/winston-transport/.eslintrc +7 -0
- package/node_modules/winston/node_modules/winston-transport/.gitattributes +1 -0
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
- package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/index.json +1 -0
- package/node_modules/winston/node_modules/winston-transport/CHANGELOG.md +126 -0
- package/node_modules/winston/node_modules/winston-transport/LICENSE +22 -0
- package/node_modules/winston/node_modules/winston-transport/README.md +50 -0
- package/node_modules/winston/node_modules/winston-transport/dist/index.js +215 -0
- package/node_modules/winston/node_modules/winston-transport/dist/legacy.js +116 -0
- package/node_modules/winston/node_modules/winston-transport/index.d.ts +39 -0
- package/node_modules/winston/node_modules/winston-transport/index.js +215 -0
- package/node_modules/winston/node_modules/winston-transport/legacy.js +119 -0
- package/node_modules/winston/node_modules/winston-transport/package.json +56 -0
- package/node_modules/winston/package.json +76 -75
- package/package.json +9 -6
- package/node_modules/@dabh/diagnostics/example.png +0 -0
- package/node_modules/color-string/CHANGELOG.md +0 -18
- package/node_modules/colorspace/test.js +0 -14
- package/node_modules/fecha/CHANGELOG.md +0 -67
- package/node_modules/logform/.travis.yml +0 -17
- package/node_modules/winston/CHANGELOG.md +0 -560
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* stream.js: Transport for outputting to any arbitrary stream.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* stream.js: Transport for outputting to any arbitrary stream.
|
|
3
|
+
*
|
|
4
|
+
* (C) 2010 Charlie Robbins
|
|
5
|
+
* MIT LICENCE
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
10
|
|
|
11
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
12
|
|
|
13
13
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
14
|
|
|
15
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
16
|
|
|
17
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
18
18
|
|
|
19
19
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
20
|
|
|
21
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
22
22
|
|
|
23
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
24
24
|
|
|
25
25
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
26
|
|
|
27
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
27
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
28
|
|
|
29
29
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30
30
|
|
|
@@ -36,10 +36,10 @@ var _require = require('triple-beam'),
|
|
|
36
36
|
var os = require('os');
|
|
37
37
|
|
|
38
38
|
var TransportStream = require('winston-transport');
|
|
39
|
-
/**
|
|
40
|
-
* Transport for outputting to any arbitrary stream.
|
|
41
|
-
* @type {Stream}
|
|
42
|
-
* @extends {TransportStream}
|
|
39
|
+
/**
|
|
40
|
+
* Transport for outputting to any arbitrary stream.
|
|
41
|
+
* @type {Stream}
|
|
42
|
+
* @extends {TransportStream}
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
|
|
@@ -48,10 +48,10 @@ module.exports = /*#__PURE__*/function (_TransportStream) {
|
|
|
48
48
|
|
|
49
49
|
var _super = _createSuper(Stream);
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* Constructor function for the Console transport object responsible for
|
|
53
|
-
* persisting log messages and metadata to a terminal or TTY.
|
|
54
|
-
* @param {!Object} [options={}] - Options for this instance.
|
|
51
|
+
/**
|
|
52
|
+
* Constructor function for the Console transport object responsible for
|
|
53
|
+
* persisting log messages and metadata to a terminal or TTY.
|
|
54
|
+
* @param {!Object} [options={}] - Options for this instance.
|
|
55
55
|
*/
|
|
56
56
|
function Stream() {
|
|
57
57
|
var _this;
|
|
@@ -73,14 +73,14 @@ module.exports = /*#__PURE__*/function (_TransportStream) {
|
|
|
73
73
|
_this._stream.setMaxListeners(Infinity);
|
|
74
74
|
|
|
75
75
|
_this.isObjectMode = options.stream._writableState.objectMode;
|
|
76
|
-
_this.eol = options.eol
|
|
76
|
+
_this.eol = typeof options.eol === 'string' ? options.eol : os.EOL;
|
|
77
77
|
return _this;
|
|
78
78
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Core logging method exposed to Winston.
|
|
81
|
-
* @param {Object} info - TODO: add param description.
|
|
82
|
-
* @param {Function} callback - TODO: add param description.
|
|
83
|
-
* @returns {undefined}
|
|
79
|
+
/**
|
|
80
|
+
* Core logging method exposed to Winston.
|
|
81
|
+
* @param {Object} info - TODO: add param description.
|
|
82
|
+
* @param {Function} callback - TODO: add param description.
|
|
83
|
+
* @returns {undefined}
|
|
84
84
|
*/
|
|
85
85
|
|
|
86
86
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* winston.js: Top-level include defining Winston.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* winston.js: Top-level include defining Winston.
|
|
3
|
+
*
|
|
4
|
+
* (C) 2010 Charlie Robbins
|
|
5
|
+
* MIT LICENCE
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
@@ -10,109 +10,103 @@ var logform = require('logform');
|
|
|
10
10
|
|
|
11
11
|
var _require = require('./winston/common'),
|
|
12
12
|
warn = _require.warn;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @type {
|
|
13
|
+
/**
|
|
14
|
+
* Expose version. Use `require` method for `webpack` support.
|
|
15
|
+
* @type {string}
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @type {
|
|
19
|
+
exports.version = require('../package.json').version;
|
|
20
|
+
/**
|
|
21
|
+
* Include transports defined by default by winston
|
|
22
|
+
* @type {Array}
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @type {
|
|
25
|
+
exports.transports = require('./winston/transports');
|
|
26
|
+
/**
|
|
27
|
+
* Expose utility methods
|
|
28
|
+
* @type {Object}
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @type {Object}
|
|
31
|
+
exports.config = require('./winston/config');
|
|
32
|
+
/**
|
|
33
|
+
* Hoist format-related functionality from logform.
|
|
34
|
+
* @type {Object}
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Hoist format-related functionality from logform.
|
|
40
|
-
* @type {Object}
|
|
37
|
+
exports.addColors = logform.levels;
|
|
38
|
+
/**
|
|
39
|
+
* Hoist format-related functionality from logform.
|
|
40
|
+
* @type {Object}
|
|
41
41
|
*/
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* @type {
|
|
43
|
+
exports.format = logform.format;
|
|
44
|
+
/**
|
|
45
|
+
* Expose core Logging-related prototypes.
|
|
46
|
+
* @type {function}
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Expose core Logging-related prototypes.
|
|
52
|
-
* @type {
|
|
49
|
+
exports.createLogger = require('./winston/create-logger');
|
|
50
|
+
/**
|
|
51
|
+
* Expose core Logging-related prototypes.
|
|
52
|
+
* @type {Object}
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Expose core Logging-related prototypes.
|
|
58
|
-
* @type {Object}
|
|
55
|
+
exports.ExceptionHandler = require('./winston/exception-handler');
|
|
56
|
+
/**
|
|
57
|
+
* Expose core Logging-related prototypes.
|
|
58
|
+
* @type {Object}
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Expose core Logging-related prototypes.
|
|
64
|
-
* @type {
|
|
61
|
+
exports.RejectionHandler = require('./winston/rejection-handler');
|
|
62
|
+
/**
|
|
63
|
+
* Expose core Logging-related prototypes.
|
|
64
|
+
* @type {Container}
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Expose core Logging-related prototypes.
|
|
70
|
-
* @type {
|
|
67
|
+
exports.Container = require('./winston/container');
|
|
68
|
+
/**
|
|
69
|
+
* Expose core Logging-related prototypes.
|
|
70
|
+
* @type {Object}
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
73
|
+
exports.Transport = require('winston-transport');
|
|
74
|
+
/**
|
|
75
|
+
* We create and expose a default `Container` to `winston.loggers` so that the
|
|
76
|
+
* programmer may manage multiple `winston.Logger` instances without any
|
|
77
|
+
* additional overhead.
|
|
78
|
+
* @example
|
|
79
|
+
* // some-file1.js
|
|
80
|
+
* const logger = require('winston').loggers.get('something');
|
|
81
|
+
*
|
|
82
|
+
* // some-file2.js
|
|
83
|
+
* const logger = require('winston').loggers.get('something');
|
|
77
84
|
*/
|
|
78
85
|
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* We create and expose a
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* // some-file2.js
|
|
89
|
-
* const logger = require('winston').loggers.get('something');
|
|
86
|
+
exports.loggers = new exports.Container();
|
|
87
|
+
/**
|
|
88
|
+
* We create and expose a 'defaultLogger' so that the programmer may do the
|
|
89
|
+
* following without the need to create an instance of winston.Logger directly:
|
|
90
|
+
* @example
|
|
91
|
+
* const winston = require('winston');
|
|
92
|
+
* winston.log('info', 'some message');
|
|
93
|
+
* winston.error('some error');
|
|
90
94
|
*/
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* We create and expose a 'defaultLogger' so that the programmer may do the
|
|
95
|
-
* following without the need to create an instance of winston.Logger directly:
|
|
96
|
-
* @example
|
|
97
|
-
* const winston = require('winston');
|
|
98
|
-
* winston.log('info', 'some message');
|
|
99
|
-
* winston.error('some error');
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
var defaultLogger = winston.createLogger(); // Pass through the target methods onto `winston.
|
|
96
|
+
var defaultLogger = exports.createLogger(); // Pass through the target methods onto `winston.
|
|
103
97
|
|
|
104
|
-
Object.keys(
|
|
105
|
-
return
|
|
98
|
+
Object.keys(exports.config.npm.levels).concat(['log', 'query', 'stream', 'add', 'remove', 'clear', 'profile', 'startTimer', 'handleExceptions', 'unhandleExceptions', 'handleRejections', 'unhandleRejections', 'configure', 'child']).forEach(function (method) {
|
|
99
|
+
return exports[method] = function () {
|
|
106
100
|
return defaultLogger[method].apply(defaultLogger, arguments);
|
|
107
101
|
};
|
|
108
102
|
});
|
|
109
|
-
/**
|
|
110
|
-
* Define getter / setter for the default logger level which need to be exposed
|
|
111
|
-
* by winston.
|
|
112
|
-
* @type {string}
|
|
103
|
+
/**
|
|
104
|
+
* Define getter / setter for the default logger level which need to be exposed
|
|
105
|
+
* by winston.
|
|
106
|
+
* @type {string}
|
|
113
107
|
*/
|
|
114
108
|
|
|
115
|
-
Object.defineProperty(
|
|
109
|
+
Object.defineProperty(exports, 'level', {
|
|
116
110
|
get: function get() {
|
|
117
111
|
return defaultLogger.level;
|
|
118
112
|
},
|
|
@@ -120,25 +114,25 @@ Object.defineProperty(winston, 'level', {
|
|
|
120
114
|
defaultLogger.level = val;
|
|
121
115
|
}
|
|
122
116
|
});
|
|
123
|
-
/**
|
|
124
|
-
* Define getter for `exceptions` which replaces `handleExceptions` and
|
|
125
|
-
* `unhandleExceptions`.
|
|
126
|
-
* @type {Object}
|
|
117
|
+
/**
|
|
118
|
+
* Define getter for `exceptions` which replaces `handleExceptions` and
|
|
119
|
+
* `unhandleExceptions`.
|
|
120
|
+
* @type {Object}
|
|
127
121
|
*/
|
|
128
122
|
|
|
129
|
-
Object.defineProperty(
|
|
123
|
+
Object.defineProperty(exports, 'exceptions', {
|
|
130
124
|
get: function get() {
|
|
131
125
|
return defaultLogger.exceptions;
|
|
132
126
|
}
|
|
133
127
|
});
|
|
134
|
-
/**
|
|
135
|
-
* Define getters / setters for appropriate properties of the default logger
|
|
136
|
-
* which need to be exposed by winston.
|
|
137
|
-
* @type {Logger}
|
|
128
|
+
/**
|
|
129
|
+
* Define getters / setters for appropriate properties of the default logger
|
|
130
|
+
* which need to be exposed by winston.
|
|
131
|
+
* @type {Logger}
|
|
138
132
|
*/
|
|
139
133
|
|
|
140
134
|
['exitOnError'].forEach(function (prop) {
|
|
141
|
-
Object.defineProperty(
|
|
135
|
+
Object.defineProperty(exports, prop, {
|
|
142
136
|
get: function get() {
|
|
143
137
|
return defaultLogger[prop];
|
|
144
138
|
},
|
|
@@ -147,12 +141,12 @@ Object.defineProperty(winston, 'exceptions', {
|
|
|
147
141
|
}
|
|
148
142
|
});
|
|
149
143
|
});
|
|
150
|
-
/**
|
|
151
|
-
* The default transports and exceptionHandlers for the default winston logger.
|
|
152
|
-
* @type {Object}
|
|
144
|
+
/**
|
|
145
|
+
* The default transports and exceptionHandlers for the default winston logger.
|
|
146
|
+
* @type {Object}
|
|
153
147
|
*/
|
|
154
148
|
|
|
155
|
-
Object.defineProperty(
|
|
149
|
+
Object.defineProperty(exports, 'default', {
|
|
156
150
|
get: function get() {
|
|
157
151
|
return {
|
|
158
152
|
exceptionHandlers: defaultLogger.exceptionHandlers,
|
|
@@ -163,10 +157,10 @@ Object.defineProperty(winston, 'default', {
|
|
|
163
157
|
}); // Have friendlier breakage notices for properties that were exposed by default
|
|
164
158
|
// on winston < 3.0.
|
|
165
159
|
|
|
166
|
-
warn.deprecated(
|
|
167
|
-
warn.forFunctions(
|
|
168
|
-
warn.forProperties(
|
|
169
|
-
warn.forFunctions(
|
|
170
|
-
warn.forProperties(
|
|
160
|
+
warn.deprecated(exports, 'setLevels');
|
|
161
|
+
warn.forFunctions(exports, 'useFormat', ['cli']);
|
|
162
|
+
warn.forProperties(exports, 'useFormat', ['padLevels', 'stripColors']);
|
|
163
|
+
warn.forFunctions(exports, 'deprecated', ['addRewriter', 'addFilter', 'clone', 'extend']);
|
|
164
|
+
warn.forProperties(exports, 'deprecated', ['emitErrs', 'levelLength']); // Throw a useful error when users attempt to run `new winston.Logger`.
|
|
171
165
|
|
|
172
|
-
warn.moved(
|
|
166
|
+
warn.moved(exports, 'createLogger', 'Logger');
|