@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,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* common.js: Internal helper and utility functions for winston.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* common.js: Internal helper and utility functions for winston.
|
|
3
|
+
*
|
|
4
|
+
* (C) 2010 Charlie Robbins
|
|
5
|
+
* MIT LICENCE
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var _require = require('util'),
|
|
10
10
|
format = _require.format;
|
|
11
|
-
/**
|
|
12
|
-
* Set of simple deprecation notices and a way to expose them for a set of
|
|
13
|
-
* properties.
|
|
14
|
-
* @type {Object}
|
|
15
|
-
* @private
|
|
11
|
+
/**
|
|
12
|
+
* Set of simple deprecation notices and a way to expose them for a set of
|
|
13
|
+
* properties.
|
|
14
|
+
* @type {Object}
|
|
15
|
+
* @private
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* index.js: Default settings for all levels that winston knows about.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* index.js: Default settings for all levels that winston knows about.
|
|
3
|
+
*
|
|
4
|
+
* (C) 2010 Charlie Robbins
|
|
5
|
+
* MIT LICENCE
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
@@ -10,28 +10,28 @@ var logform = require('logform');
|
|
|
10
10
|
|
|
11
11
|
var _require = require('triple-beam'),
|
|
12
12
|
configs = _require.configs;
|
|
13
|
-
/**
|
|
14
|
-
* Export config set for the CLI.
|
|
15
|
-
* @type {Object}
|
|
13
|
+
/**
|
|
14
|
+
* Export config set for the CLI.
|
|
15
|
+
* @type {Object}
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
exports.cli = logform.levels(configs.cli);
|
|
20
|
-
/**
|
|
21
|
-
* Export config set for npm.
|
|
22
|
-
* @type {Object}
|
|
20
|
+
/**
|
|
21
|
+
* Export config set for npm.
|
|
22
|
+
* @type {Object}
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
exports.npm = logform.levels(configs.npm);
|
|
26
|
-
/**
|
|
27
|
-
* Export config set for the syslog.
|
|
28
|
-
* @type {Object}
|
|
26
|
+
/**
|
|
27
|
+
* Export config set for the syslog.
|
|
28
|
+
* @type {Object}
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
exports.syslog = logform.levels(configs.syslog);
|
|
32
|
-
/**
|
|
33
|
-
* Hoist addColors from logform where it was refactored into in winston@3.
|
|
34
|
-
* @type {Object}
|
|
32
|
+
/**
|
|
33
|
+
* Hoist addColors from logform where it was refactored into in winston@3.
|
|
34
|
+
* @type {Object}
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
exports.addColors = logform.levels;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* container.js: Inversion of control container for winston logger instances.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* container.js: Inversion of control container for winston logger instances.
|
|
3
|
+
*
|
|
4
|
+
* (C) 2010 Charlie Robbins
|
|
5
|
+
* MIT LICENCE
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
@@ -10,20 +10,20 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
10
10
|
|
|
11
11
|
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); } }
|
|
12
12
|
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
14
|
|
|
15
15
|
var createLogger = require('./create-logger');
|
|
16
|
-
/**
|
|
17
|
-
* Inversion of control container for winston logger instances.
|
|
18
|
-
* @type {Container}
|
|
16
|
+
/**
|
|
17
|
+
* Inversion of control container for winston logger instances.
|
|
18
|
+
* @type {Container}
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
module.exports = /*#__PURE__*/function () {
|
|
23
|
-
/**
|
|
24
|
-
* Constructor function for the Container object responsible for managing a
|
|
25
|
-
* set of `winston.Logger` instances based on string ids.
|
|
26
|
-
* @param {!Object} [options={}] - Default pass-thru options for Loggers.
|
|
23
|
+
/**
|
|
24
|
+
* Constructor function for the Container object responsible for managing a
|
|
25
|
+
* set of `winston.Logger` instances based on string ids.
|
|
26
|
+
* @param {!Object} [options={}] - Default pass-thru options for Loggers.
|
|
27
27
|
*/
|
|
28
28
|
function Container() {
|
|
29
29
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -33,12 +33,12 @@ module.exports = /*#__PURE__*/function () {
|
|
|
33
33
|
this.loggers = new Map();
|
|
34
34
|
this.options = options;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* instance does not exist, one is created.
|
|
39
|
-
* @param {!string} id - The id of the Logger to get.
|
|
40
|
-
* @param {?Object} [options] - Options for the Logger instance.
|
|
41
|
-
* @returns {Logger} - A configured Logger instance with a specified id.
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a `winston.Logger` instance for the specified `id`. If an
|
|
38
|
+
* instance does not exist, one is created.
|
|
39
|
+
* @param {!string} id - The id of the Logger to get.
|
|
40
|
+
* @param {?Object} [options] - Options for the Logger instance.
|
|
41
|
+
* @returns {Logger} - A configured Logger instance with a specified id.
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
44
|
|
|
@@ -64,12 +64,12 @@ module.exports = /*#__PURE__*/function () {
|
|
|
64
64
|
|
|
65
65
|
return this.loggers.get(id);
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Retreives a `winston.Logger` instance for the specified `id`. If
|
|
69
|
-
* an instance does not exist, one is created.
|
|
70
|
-
* @param {!string} id - The id of the Logger to get.
|
|
71
|
-
* @param {?Object} [options] - Options for the Logger instance.
|
|
72
|
-
* @returns {Logger} - A configured Logger instance with a specified id.
|
|
67
|
+
/**
|
|
68
|
+
* Retreives a `winston.Logger` instance for the specified `id`. If
|
|
69
|
+
* an instance does not exist, one is created.
|
|
70
|
+
* @param {!string} id - The id of the Logger to get.
|
|
71
|
+
* @param {?Object} [options] - Options for the Logger instance.
|
|
72
|
+
* @returns {Logger} - A configured Logger instance with a specified id.
|
|
73
73
|
*/
|
|
74
74
|
|
|
75
75
|
}, {
|
|
@@ -77,11 +77,11 @@ module.exports = /*#__PURE__*/function () {
|
|
|
77
77
|
value: function get(id, options) {
|
|
78
78
|
return this.add(id, options);
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Check if the container has a logger with the id.
|
|
82
|
-
* @param {?string} id - The id of the Logger instance to find.
|
|
83
|
-
* @returns {boolean} - Boolean value indicating if this instance has a
|
|
84
|
-
* logger with the specified `id`.
|
|
80
|
+
/**
|
|
81
|
+
* Check if the container has a logger with the id.
|
|
82
|
+
* @param {?string} id - The id of the Logger instance to find.
|
|
83
|
+
* @returns {boolean} - Boolean value indicating if this instance has a
|
|
84
|
+
* logger with the specified `id`.
|
|
85
85
|
*/
|
|
86
86
|
|
|
87
87
|
}, {
|
|
@@ -89,11 +89,11 @@ module.exports = /*#__PURE__*/function () {
|
|
|
89
89
|
value: function has(id) {
|
|
90
90
|
return !!this.loggers.has(id);
|
|
91
91
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Closes a `Logger` instance with the specified `id` if it exists.
|
|
94
|
-
* If no `id` is supplied then all Loggers are closed.
|
|
95
|
-
* @param {?string} id - The id of the Logger instance to close.
|
|
96
|
-
* @returns {undefined}
|
|
92
|
+
/**
|
|
93
|
+
* Closes a `Logger` instance with the specified `id` if it exists.
|
|
94
|
+
* If no `id` is supplied then all Loggers are closed.
|
|
95
|
+
* @param {?string} id - The id of the Logger instance to close.
|
|
96
|
+
* @returns {undefined}
|
|
97
97
|
*/
|
|
98
98
|
|
|
99
99
|
}, {
|
|
@@ -109,11 +109,11 @@ module.exports = /*#__PURE__*/function () {
|
|
|
109
109
|
return _this2._removeLogger(key);
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
/**
|
|
113
|
-
* Remove a logger based on the id.
|
|
114
|
-
* @param {!string} id - The id of the logger to remove.
|
|
115
|
-
* @returns {undefined}
|
|
116
|
-
* @private
|
|
112
|
+
/**
|
|
113
|
+
* Remove a logger based on the id.
|
|
114
|
+
* @param {!string} id - The id of the logger to remove.
|
|
115
|
+
* @returns {undefined}
|
|
116
|
+
* @private
|
|
117
117
|
*/
|
|
118
118
|
|
|
119
119
|
}, {
|
|
@@ -128,12 +128,12 @@ module.exports = /*#__PURE__*/function () {
|
|
|
128
128
|
|
|
129
129
|
this._delete(id);
|
|
130
130
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Deletes a `Logger` instance with the specified `id`.
|
|
133
|
-
* @param {!string} id - The id of the Logger instance to delete from
|
|
134
|
-
* container.
|
|
135
|
-
* @returns {undefined}
|
|
136
|
-
* @private
|
|
131
|
+
/**
|
|
132
|
+
* Deletes a `Logger` instance with the specified `id`.
|
|
133
|
+
* @param {!string} id - The id of the Logger instance to delete from
|
|
134
|
+
* container.
|
|
135
|
+
* @returns {undefined}
|
|
136
|
+
* @private
|
|
137
137
|
*/
|
|
138
138
|
|
|
139
139
|
}, {
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* create-logger.js: Logger factory for winston logger instances.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* create-logger.js: Logger factory for winston logger instances.
|
|
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
|
+
|
|
11
|
+
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); } }
|
|
12
|
+
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
14
|
|
|
11
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
16
|
|
|
13
|
-
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); }
|
|
14
18
|
|
|
15
19
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
20
|
|
|
17
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); }; }
|
|
18
22
|
|
|
19
|
-
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); }
|
|
20
24
|
|
|
21
25
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
26
|
|
|
23
|
-
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; } }
|
|
24
28
|
|
|
25
29
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
30
|
|
|
@@ -36,11 +40,11 @@ var debug = require('@dabh/diagnostics')('winston:create-logger');
|
|
|
36
40
|
function isLevelEnabledFunctionName(level) {
|
|
37
41
|
return 'is' + level.charAt(0).toUpperCase() + level.slice(1) + 'Enabled';
|
|
38
42
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Create a new instance of a winston Logger. Creates a new
|
|
41
|
-
* prototype for each instance.
|
|
42
|
-
* @param {!Object} opts - Options for the created logger.
|
|
43
|
-
* @returns {Logger} - A newly created logger instance.
|
|
43
|
+
/**
|
|
44
|
+
* Create a new instance of a winston Logger. Creates a new
|
|
45
|
+
* prototype for each instance.
|
|
46
|
+
* @param {!Object} opts - Options for the created logger.
|
|
47
|
+
* @returns {Logger} - A newly created logger instance.
|
|
44
48
|
*/
|
|
45
49
|
|
|
46
50
|
|
|
@@ -50,10 +54,10 @@ module.exports = function () {
|
|
|
50
54
|
// Default levels: npm
|
|
51
55
|
//
|
|
52
56
|
opts.levels = opts.levels || config.npm.levels;
|
|
53
|
-
/**
|
|
54
|
-
* DerivedLogger to attach the logs level methods.
|
|
55
|
-
* @type {DerivedLogger}
|
|
56
|
-
* @extends {Logger}
|
|
57
|
+
/**
|
|
58
|
+
* DerivedLogger to attach the logs level methods.
|
|
59
|
+
* @type {DerivedLogger}
|
|
60
|
+
* @extends {Logger}
|
|
57
61
|
*/
|
|
58
62
|
|
|
59
63
|
var DerivedLogger = /*#__PURE__*/function (_Logger) {
|
|
@@ -61,11 +65,11 @@ module.exports = function () {
|
|
|
61
65
|
|
|
62
66
|
var _super = _createSuper(DerivedLogger);
|
|
63
67
|
|
|
64
|
-
/**
|
|
65
|
-
* Create a new class derived logger for which the levels can be attached to
|
|
66
|
-
* the prototype of. This is a V8 optimization that is well know to increase
|
|
67
|
-
* performance of prototype functions.
|
|
68
|
-
* @param {!Object} options - Options for the created logger.
|
|
68
|
+
/**
|
|
69
|
+
* Create a new class derived logger for which the levels can be attached to
|
|
70
|
+
* the prototype of. This is a V8 optimization that is well know to increase
|
|
71
|
+
* performance of prototype functions.
|
|
72
|
+
* @param {!Object} options - Options for the created logger.
|
|
69
73
|
*/
|
|
70
74
|
function DerivedLogger(options) {
|
|
71
75
|
_classCallCheck(this, DerivedLogger);
|
|
@@ -73,7 +77,7 @@ module.exports = function () {
|
|
|
73
77
|
return _super.call(this, options);
|
|
74
78
|
}
|
|
75
79
|
|
|
76
|
-
return DerivedLogger;
|
|
80
|
+
return _createClass(DerivedLogger);
|
|
77
81
|
}(Logger);
|
|
78
82
|
|
|
79
83
|
var logger = new DerivedLogger(opts); //
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* exception-handler.js: Object for handling uncaughtException events.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* exception-handler.js: Object for handling uncaughtException events.
|
|
3
|
+
*
|
|
4
|
+
* (C) 2010 Charlie Robbins
|
|
5
|
+
* MIT LICENCE
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
10
10
|
|
|
11
11
|
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); } }
|
|
12
12
|
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
14
|
|
|
15
15
|
var os = require('os');
|
|
16
16
|
|
|
@@ -23,16 +23,16 @@ var once = require('one-time');
|
|
|
23
23
|
var stackTrace = require('stack-trace');
|
|
24
24
|
|
|
25
25
|
var ExceptionStream = require('./exception-stream');
|
|
26
|
-
/**
|
|
27
|
-
* Object for handling uncaughtException events.
|
|
28
|
-
* @type {ExceptionHandler}
|
|
26
|
+
/**
|
|
27
|
+
* Object for handling uncaughtException events.
|
|
28
|
+
* @type {ExceptionHandler}
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
module.exports = /*#__PURE__*/function () {
|
|
33
|
-
/**
|
|
34
|
-
* TODO: add contructor description
|
|
35
|
-
* @param {!Logger} logger - TODO: add param description
|
|
33
|
+
/**
|
|
34
|
+
* TODO: add contructor description
|
|
35
|
+
* @param {!Logger} logger - TODO: add param description
|
|
36
36
|
*/
|
|
37
37
|
function ExceptionHandler(logger) {
|
|
38
38
|
_classCallCheck(this, ExceptionHandler);
|
|
@@ -44,10 +44,10 @@ module.exports = /*#__PURE__*/function () {
|
|
|
44
44
|
this.logger = logger;
|
|
45
45
|
this.handlers = new Map();
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Handles `uncaughtException` events for the current process by adding any
|
|
49
|
-
* handlers passed in.
|
|
50
|
-
* @returns {undefined}
|
|
47
|
+
/**
|
|
48
|
+
* Handles `uncaughtException` events for the current process by adding any
|
|
49
|
+
* handlers passed in.
|
|
50
|
+
* @returns {undefined}
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
53
|
|
|
@@ -75,10 +75,10 @@ module.exports = /*#__PURE__*/function () {
|
|
|
75
75
|
process.on('uncaughtException', this.catcher);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Removes any handlers to `uncaughtException` events for the current
|
|
80
|
-
* process. This does not modify the state of the `this.handlers` set.
|
|
81
|
-
* @returns {undefined}
|
|
78
|
+
/**
|
|
79
|
+
* Removes any handlers to `uncaughtException` events for the current
|
|
80
|
+
* process. This does not modify the state of the `this.handlers` set.
|
|
81
|
+
* @returns {undefined}
|
|
82
82
|
*/
|
|
83
83
|
|
|
84
84
|
}, {
|
|
@@ -94,10 +94,10 @@ module.exports = /*#__PURE__*/function () {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
/**
|
|
98
|
-
* TODO: add method description
|
|
99
|
-
* @param {Error} err - Error to get information about.
|
|
100
|
-
* @returns {mixed} - TODO: add return description.
|
|
97
|
+
/**
|
|
98
|
+
* TODO: add method description
|
|
99
|
+
* @param {Error} err - Error to get information about.
|
|
100
|
+
* @returns {mixed} - TODO: add return description.
|
|
101
101
|
*/
|
|
102
102
|
|
|
103
103
|
}, {
|
|
@@ -122,9 +122,9 @@ module.exports = /*#__PURE__*/function () {
|
|
|
122
122
|
trace: this.getTrace(err)
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Gets all relevant process information for the currently running process.
|
|
127
|
-
* @returns {mixed} - TODO: add return description.
|
|
125
|
+
/**
|
|
126
|
+
* Gets all relevant process information for the currently running process.
|
|
127
|
+
* @returns {mixed} - TODO: add return description.
|
|
128
128
|
*/
|
|
129
129
|
|
|
130
130
|
}, {
|
|
@@ -141,9 +141,9 @@ module.exports = /*#__PURE__*/function () {
|
|
|
141
141
|
memoryUsage: process.memoryUsage()
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Gets all relevant OS information for the currently running process.
|
|
146
|
-
* @returns {mixed} - TODO: add return description.
|
|
144
|
+
/**
|
|
145
|
+
* Gets all relevant OS information for the currently running process.
|
|
146
|
+
* @returns {mixed} - TODO: add return description.
|
|
147
147
|
*/
|
|
148
148
|
|
|
149
149
|
}, {
|
|
@@ -154,10 +154,10 @@ module.exports = /*#__PURE__*/function () {
|
|
|
154
154
|
uptime: os.uptime()
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
/**
|
|
158
|
-
* Gets a stack trace for the specified error.
|
|
159
|
-
* @param {mixed} err - TODO: add param description.
|
|
160
|
-
* @returns {mixed} - TODO: add return description.
|
|
157
|
+
/**
|
|
158
|
+
* Gets a stack trace for the specified error.
|
|
159
|
+
* @param {mixed} err - TODO: add param description.
|
|
160
|
+
* @returns {mixed} - TODO: add return description.
|
|
161
161
|
*/
|
|
162
162
|
|
|
163
163
|
}, {
|
|
@@ -175,10 +175,10 @@ module.exports = /*#__PURE__*/function () {
|
|
|
175
175
|
};
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
/**
|
|
179
|
-
* Helper method to add a transport as an exception handler.
|
|
180
|
-
* @param {Transport} handler - The transport to add as an exception handler.
|
|
181
|
-
* @returns {void}
|
|
178
|
+
/**
|
|
179
|
+
* Helper method to add a transport as an exception handler.
|
|
180
|
+
* @param {Transport} handler - The transport to add as an exception handler.
|
|
181
|
+
* @returns {void}
|
|
182
182
|
*/
|
|
183
183
|
|
|
184
184
|
}, {
|
|
@@ -191,12 +191,12 @@ module.exports = /*#__PURE__*/function () {
|
|
|
191
191
|
this.logger.pipe(wrapper);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
/**
|
|
195
|
-
* Logs all relevant information around the `err` and exits the current
|
|
196
|
-
* process.
|
|
197
|
-
* @param {Error} err - Error to handle
|
|
198
|
-
* @returns {mixed} - TODO: add return description.
|
|
199
|
-
* @private
|
|
194
|
+
/**
|
|
195
|
+
* Logs all relevant information around the `err` and exits the current
|
|
196
|
+
* process.
|
|
197
|
+
* @param {Error} err - Error to handle
|
|
198
|
+
* @returns {mixed} - TODO: add return description.
|
|
199
|
+
* @private
|
|
200
200
|
*/
|
|
201
201
|
|
|
202
202
|
}, {
|
|
@@ -263,11 +263,11 @@ module.exports = /*#__PURE__*/function () {
|
|
|
263
263
|
timeout = setTimeout(gracefulExit, 3000);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
/**
|
|
267
|
-
* Returns the list of transports and exceptionHandlers for this instance.
|
|
268
|
-
* @returns {Array} - List of transports and exceptionHandlers for this
|
|
269
|
-
* instance.
|
|
270
|
-
* @private
|
|
266
|
+
/**
|
|
267
|
+
* Returns the list of transports and exceptionHandlers for this instance.
|
|
268
|
+
* @returns {Array} - List of transports and exceptionHandlers for this
|
|
269
|
+
* instance.
|
|
270
|
+
* @private
|
|
271
271
|
*/
|
|
272
272
|
|
|
273
273
|
}, {
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* exception-stream.js: TODO: add file header handler.
|
|
3
|
-
*
|
|
4
|
-
* (C) 2010 Charlie Robbins
|
|
5
|
-
* MIT LICENCE
|
|
1
|
+
/**
|
|
2
|
+
* exception-stream.js: TODO: add file header handler.
|
|
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
|
|
|
31
31
|
var _require = require('readable-stream'),
|
|
32
32
|
Writable = _require.Writable;
|
|
33
|
-
/**
|
|
34
|
-
* TODO: add class description.
|
|
35
|
-
* @type {ExceptionStream}
|
|
36
|
-
* @extends {Writable}
|
|
33
|
+
/**
|
|
34
|
+
* TODO: add class description.
|
|
35
|
+
* @type {ExceptionStream}
|
|
36
|
+
* @extends {Writable}
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
|
|
@@ -42,11 +42,11 @@ module.exports = /*#__PURE__*/function (_Writable) {
|
|
|
42
42
|
|
|
43
43
|
var _super = _createSuper(ExceptionStream);
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* Constructor function for the ExceptionStream responsible for wrapping a
|
|
47
|
-
* TransportStream; only allowing writes of `info` objects with
|
|
48
|
-
* `info.exception` set to true.
|
|
49
|
-
* @param {!TransportStream} transport - Stream to filter to exceptions
|
|
45
|
+
/**
|
|
46
|
+
* Constructor function for the ExceptionStream responsible for wrapping a
|
|
47
|
+
* TransportStream; only allowing writes of `info` objects with
|
|
48
|
+
* `info.exception` set to true.
|
|
49
|
+
* @param {!TransportStream} transport - Stream to filter to exceptions
|
|
50
50
|
*/
|
|
51
51
|
function ExceptionStream(transport) {
|
|
52
52
|
var _this;
|
|
@@ -67,14 +67,14 @@ module.exports = /*#__PURE__*/function (_Writable) {
|
|
|
67
67
|
_this.transport = transport;
|
|
68
68
|
return _this;
|
|
69
69
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Writes the info object to our transport instance if (and only if) the
|
|
72
|
-
* `exception` property is set on the info.
|
|
73
|
-
* @param {mixed} info - TODO: add param description.
|
|
74
|
-
* @param {mixed} enc - TODO: add param description.
|
|
75
|
-
* @param {mixed} callback - TODO: add param description.
|
|
76
|
-
* @returns {mixed} - TODO: add return description.
|
|
77
|
-
* @private
|
|
70
|
+
/**
|
|
71
|
+
* Writes the info object to our transport instance if (and only if) the
|
|
72
|
+
* `exception` property is set on the info.
|
|
73
|
+
* @param {mixed} info - TODO: add param description.
|
|
74
|
+
* @param {mixed} enc - TODO: add param description.
|
|
75
|
+
* @param {mixed} callback - TODO: add param description.
|
|
76
|
+
* @returns {mixed} - TODO: add return description.
|
|
77
|
+
* @private
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
80
|
|