@contrast/agent 4.16.2 → 4.17.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/contrast.js +1 -1
- package/lib/core/rewrite/index.js +2 -2
- 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 +6 -4
- 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,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const colors = require('colors/safe');
|
|
3
|
+
const colors = require('@colors/colors/safe');
|
|
4
4
|
const { LEVEL, MESSAGE } = require('triple-beam');
|
|
5
5
|
|
|
6
6
|
//
|
|
@@ -58,7 +58,7 @@ class Colorizer {
|
|
|
58
58
|
|
|
59
59
|
/*
|
|
60
60
|
* function colorize (lookup, level, message)
|
|
61
|
-
* Performs multi-step colorization using colors/safe
|
|
61
|
+
* Performs multi-step colorization using @colors/colors/safe
|
|
62
62
|
*/
|
|
63
63
|
colorize(lookup, level, message) {
|
|
64
64
|
if (typeof message === 'undefined') {
|
|
@@ -25,11 +25,14 @@ Object.defineProperty(format, 'align', {
|
|
|
25
25
|
Object.defineProperty(format, 'cli', {
|
|
26
26
|
value: require('./cli')
|
|
27
27
|
});
|
|
28
|
+
Object.defineProperty(format, 'colorize', {
|
|
29
|
+
value: require('./colorize')
|
|
30
|
+
});
|
|
28
31
|
Object.defineProperty(format, 'combine', {
|
|
29
32
|
value: require('./combine')
|
|
30
33
|
});
|
|
31
|
-
Object.defineProperty(format, '
|
|
32
|
-
value: require('./
|
|
34
|
+
Object.defineProperty(format, 'errors', {
|
|
35
|
+
value: require('./errors')
|
|
33
36
|
});
|
|
34
37
|
Object.defineProperty(format, 'json', {
|
|
35
38
|
value: require('./json')
|
|
@@ -43,6 +46,9 @@ Object.defineProperty(format, 'logstash', {
|
|
|
43
46
|
Object.defineProperty(format, 'metadata', {
|
|
44
47
|
value: require('./metadata')
|
|
45
48
|
});
|
|
49
|
+
Object.defineProperty(format, 'ms', {
|
|
50
|
+
value: require('./ms')
|
|
51
|
+
});
|
|
46
52
|
Object.defineProperty(format, 'padLevels', {
|
|
47
53
|
value: require('./pad-levels')
|
|
48
54
|
});
|
|
@@ -4,7 +4,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
4
4
|
|
|
5
5
|
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); } }
|
|
6
6
|
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
8
|
|
|
9
9
|
var _require = require('./colorize'),
|
|
10
10
|
Colorizer = _require.Colorizer;
|
|
@@ -28,7 +28,7 @@ var CliFormat = /*#__PURE__*/function () {
|
|
|
28
28
|
_classCallCheck(this, CliFormat);
|
|
29
29
|
|
|
30
30
|
if (!opts.levels) {
|
|
31
|
-
opts.levels = configs.
|
|
31
|
+
opts.levels = configs.cli.levels;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
this.colorizer = new Colorizer(opts);
|
|
@@ -4,9 +4,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
4
4
|
|
|
5
5
|
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); } }
|
|
6
6
|
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
8
|
|
|
9
|
-
var colors = require('colors/safe');
|
|
9
|
+
var colors = require('@colors/colors/safe');
|
|
10
10
|
|
|
11
11
|
var _require = require('triple-beam'),
|
|
12
12
|
LEVEL = _require.LEVEL,
|
|
@@ -49,19 +49,19 @@ var Colorizer = /*#__PURE__*/function () {
|
|
|
49
49
|
|
|
50
50
|
_createClass(Colorizer, [{
|
|
51
51
|
key: "addColors",
|
|
52
|
-
|
|
52
|
+
value:
|
|
53
53
|
/*
|
|
54
54
|
* Adds the colors Object to the set of allColors
|
|
55
55
|
* known by the Colorizer
|
|
56
56
|
*
|
|
57
57
|
* @param {Object} colors Set of color mappings to add.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
function addColors(clrs) {
|
|
60
60
|
return Colorizer.addColors(clrs);
|
|
61
61
|
}
|
|
62
62
|
/*
|
|
63
63
|
* function colorize (lookup, level, message)
|
|
64
|
-
* Performs multi-step colorization using colors/safe
|
|
64
|
+
* Performs multi-step colorization using @colors/colors/safe
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
67
|
}, {
|
|
@@ -33,8 +33,8 @@ module.exports = format(function (einfo, _ref) {
|
|
|
33
33
|
if (!(einfo.message instanceof Error)) return einfo; // Assign all enumerable properties and the
|
|
34
34
|
// message property from the error provided.
|
|
35
35
|
|
|
36
|
-
Object.assign(einfo, einfo.message);
|
|
37
36
|
var err = einfo.message;
|
|
37
|
+
Object.assign(einfo, err);
|
|
38
38
|
einfo.message = err.message;
|
|
39
39
|
einfo[MESSAGE] = err.message; // Assign the stack if requested.
|
|
40
40
|
|
|
@@ -4,15 +4,19 @@
|
|
|
4
4
|
* the format when it is invalid.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
7
|
+
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); }
|
|
8
|
+
|
|
9
|
+
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); } }
|
|
10
|
+
|
|
11
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
12
|
|
|
9
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
14
|
|
|
11
|
-
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); }
|
|
15
|
+
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); }
|
|
12
16
|
|
|
13
17
|
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); }; }
|
|
14
18
|
|
|
15
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
19
|
+
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); }
|
|
16
20
|
|
|
17
21
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
22
|
|
|
@@ -20,7 +24,7 @@ function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new
|
|
|
20
24
|
|
|
21
25
|
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
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 _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
26
30
|
|
|
@@ -43,7 +47,7 @@ var InvalidFormatError = /*#__PURE__*/function (_Error) {
|
|
|
43
47
|
return _this;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
return InvalidFormatError;
|
|
50
|
+
return _createClass(InvalidFormatError);
|
|
47
51
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
48
52
|
/*
|
|
49
53
|
* function format (formatFn)
|
|
@@ -22,11 +22,10 @@ exports.levels = require('./levels');
|
|
|
22
22
|
* as a lazy-loaded getter.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
function exposeFormat(name,
|
|
26
|
-
path = path || name;
|
|
25
|
+
function exposeFormat(name, requireFormat) {
|
|
27
26
|
Object.defineProperty(format, name, {
|
|
28
27
|
get: function get() {
|
|
29
|
-
return
|
|
28
|
+
return requireFormat();
|
|
30
29
|
},
|
|
31
30
|
configurable: true
|
|
32
31
|
});
|
|
@@ -35,20 +34,54 @@ function exposeFormat(name, path) {
|
|
|
35
34
|
//
|
|
36
35
|
|
|
37
36
|
|
|
38
|
-
exposeFormat('align')
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
exposeFormat('
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
exposeFormat('
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
exposeFormat('
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
exposeFormat('
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
exposeFormat('
|
|
54
|
-
|
|
37
|
+
exposeFormat('align', function () {
|
|
38
|
+
return require('./align');
|
|
39
|
+
});
|
|
40
|
+
exposeFormat('errors', function () {
|
|
41
|
+
return require('./errors');
|
|
42
|
+
});
|
|
43
|
+
exposeFormat('cli', function () {
|
|
44
|
+
return require('./cli');
|
|
45
|
+
});
|
|
46
|
+
exposeFormat('combine', function () {
|
|
47
|
+
return require('./combine');
|
|
48
|
+
});
|
|
49
|
+
exposeFormat('colorize', function () {
|
|
50
|
+
return require('./colorize');
|
|
51
|
+
});
|
|
52
|
+
exposeFormat('json', function () {
|
|
53
|
+
return require('./json');
|
|
54
|
+
});
|
|
55
|
+
exposeFormat('label', function () {
|
|
56
|
+
return require('./label');
|
|
57
|
+
});
|
|
58
|
+
exposeFormat('logstash', function () {
|
|
59
|
+
return require('./logstash');
|
|
60
|
+
});
|
|
61
|
+
exposeFormat('metadata', function () {
|
|
62
|
+
return require('./metadata');
|
|
63
|
+
});
|
|
64
|
+
exposeFormat('ms', function () {
|
|
65
|
+
return require('./ms');
|
|
66
|
+
});
|
|
67
|
+
exposeFormat('padLevels', function () {
|
|
68
|
+
return require('./pad-levels');
|
|
69
|
+
});
|
|
70
|
+
exposeFormat('prettyPrint', function () {
|
|
71
|
+
return require('./pretty-print');
|
|
72
|
+
});
|
|
73
|
+
exposeFormat('printf', function () {
|
|
74
|
+
return require('./printf');
|
|
75
|
+
});
|
|
76
|
+
exposeFormat('simple', function () {
|
|
77
|
+
return require('./simple');
|
|
78
|
+
});
|
|
79
|
+
exposeFormat('splat', function () {
|
|
80
|
+
return require('./splat');
|
|
81
|
+
});
|
|
82
|
+
exposeFormat('timestamp', function () {
|
|
83
|
+
return require('./timestamp');
|
|
84
|
+
});
|
|
85
|
+
exposeFormat('uncolorize', function () {
|
|
86
|
+
return require('./uncolorize');
|
|
87
|
+
});
|
|
@@ -5,7 +5,7 @@ var format = require('./format');
|
|
|
5
5
|
var _require = require('triple-beam'),
|
|
6
6
|
MESSAGE = _require.MESSAGE;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var stringify = require('safe-stable-stringify');
|
|
9
9
|
/*
|
|
10
10
|
* function replacer (key, value)
|
|
11
11
|
* Handles proper stringification of Buffer and bigint output.
|
|
@@ -13,8 +13,9 @@ var jsonStringify = require('fast-safe-stringify');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
function replacer(key, value) {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// safe-stable-stringify does support BigInt, however, it doesn't wrap the value in quotes.
|
|
17
|
+
// Leading to a loss in fidelity if the resulting string is parsed.
|
|
18
|
+
// It would also be a breaking change for logform.
|
|
18
19
|
if (typeof value === 'bigint') return value.toString();
|
|
19
20
|
return value;
|
|
20
21
|
}
|
|
@@ -26,8 +27,8 @@ function replacer(key, value) {
|
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
|
|
29
|
-
module.exports = format(function (info) {
|
|
30
|
-
var
|
|
31
|
-
info[MESSAGE] =
|
|
30
|
+
module.exports = format(function (info, opts) {
|
|
31
|
+
var jsonStringify = stringify.configure(opts);
|
|
32
|
+
info[MESSAGE] = jsonStringify(info, opts.replacer || replacer, opts.space);
|
|
32
33
|
return info;
|
|
33
34
|
});
|
|
@@ -5,7 +5,7 @@ var format = require('./format');
|
|
|
5
5
|
var _require = require('triple-beam'),
|
|
6
6
|
MESSAGE = _require.MESSAGE;
|
|
7
7
|
|
|
8
|
-
var jsonStringify = require('
|
|
8
|
+
var jsonStringify = require('safe-stable-stringify');
|
|
9
9
|
/*
|
|
10
10
|
* function logstash (info)
|
|
11
11
|
* Returns a new instance of the LogStash Format that turns a
|
|
@@ -7,7 +7,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
7
7
|
|
|
8
8
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
9
|
|
|
10
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
11
|
|
|
12
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
17
17
|
|
|
18
18
|
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); } }
|
|
19
19
|
|
|
20
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
21
|
|
|
22
22
|
var _require = require('triple-beam'),
|
|
23
23
|
configs = _require.configs,
|
|
@@ -44,7 +44,7 @@ var Padder = /*#__PURE__*/function () {
|
|
|
44
44
|
|
|
45
45
|
_createClass(Padder, [{
|
|
46
46
|
key: "transform",
|
|
47
|
-
|
|
47
|
+
value:
|
|
48
48
|
/**
|
|
49
49
|
* Prepends the padding onto the `message` based on the `LEVEL` of
|
|
50
50
|
* the `info`. This is based on the behavior of `winston@2` which also
|
|
@@ -56,7 +56,7 @@ var Padder = /*#__PURE__*/function () {
|
|
|
56
56
|
* @param {Object} opts Options passed along to this instance.
|
|
57
57
|
* @returns {Info} Modified logform info object.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
function transform(info, opts) {
|
|
60
60
|
info.message = "".concat(this.paddings[info[LEVEL]]).concat(info.message);
|
|
61
61
|
|
|
62
62
|
if (info[MESSAGE]) {
|
|
@@ -4,7 +4,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
4
4
|
|
|
5
5
|
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); } }
|
|
6
6
|
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
8
|
|
|
9
9
|
var _require = require('triple-beam'),
|
|
10
10
|
MESSAGE = _require.MESSAGE;
|
|
@@ -6,7 +6,7 @@ var format = require('./format');
|
|
|
6
6
|
var _require = require('triple-beam'),
|
|
7
7
|
MESSAGE = _require.MESSAGE;
|
|
8
8
|
|
|
9
|
-
var jsonStringify = require('
|
|
9
|
+
var jsonStringify = require('safe-stable-stringify');
|
|
10
10
|
/*
|
|
11
11
|
* function simple (info)
|
|
12
12
|
* Returns a new instance of the simple format TransformStream
|
|
@@ -6,7 +6,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
6
6
|
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
8
|
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
10
|
|
|
11
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
16
16
|
|
|
17
17
|
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); } }
|
|
18
18
|
|
|
19
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
19
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
20
|
|
|
21
21
|
var util = require('util');
|
|
22
22
|
|
|
@@ -28,8 +28,8 @@ module.exports = format((einfo, { stack }) => {
|
|
|
28
28
|
|
|
29
29
|
// Assign all enumerable properties and the
|
|
30
30
|
// message property from the error provided.
|
|
31
|
-
Object.assign(einfo, einfo.message);
|
|
32
31
|
const err = einfo.message;
|
|
32
|
+
Object.assign(einfo, err);
|
|
33
33
|
einfo.message = err.message;
|
|
34
34
|
einfo[MESSAGE] = err.message;
|
|
35
35
|
|
|
@@ -83,6 +83,42 @@ export interface JsonOptions {
|
|
|
83
83
|
* The number of white space used to format the json.
|
|
84
84
|
*/
|
|
85
85
|
space?: number;
|
|
86
|
+
|
|
87
|
+
// The following options come from safe-stable-stringify
|
|
88
|
+
// https://github.com/BridgeAR/safe-stable-stringify/blob/main/index.d.ts
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* If `true`, bigint values are converted to a number. Otherwise, they are ignored.
|
|
92
|
+
* This option is ignored by default as Logform stringifies BigInt in the default replacer.
|
|
93
|
+
* @default true
|
|
94
|
+
*/
|
|
95
|
+
bigint?: boolean,
|
|
96
|
+
/**
|
|
97
|
+
* Defines the value for circular references.
|
|
98
|
+
* Set to `undefined`, circular properties are not serialized (array entries are replaced with null).
|
|
99
|
+
* Set to `Error`, to throw on circular references.
|
|
100
|
+
* @default "[Circular]"
|
|
101
|
+
*/
|
|
102
|
+
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
|
|
103
|
+
/**
|
|
104
|
+
* If `true`, guarantee a deterministic key order instead of relying on the insertion order.
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
deterministic?: boolean,
|
|
108
|
+
/**
|
|
109
|
+
* Maximum number of entries to serialize per object (at least one).
|
|
110
|
+
* The serialized output contains information about how many entries have not been serialized.
|
|
111
|
+
* Ignored properties are counted as well (e.g., properties with symbol values).
|
|
112
|
+
* Using the array replacer overrules this option.
|
|
113
|
+
* @default Infinity
|
|
114
|
+
*/
|
|
115
|
+
maximumBreadth?: number,
|
|
116
|
+
/**
|
|
117
|
+
* Maximum number of object nesting levels (at least 1) that will be serialized.
|
|
118
|
+
* Objects at the maximum level are serialized as `"[Object]"` and arrays as `"[Array]"`.
|
|
119
|
+
* @default Infinity
|
|
120
|
+
*/
|
|
121
|
+
maximumDepth?: number,
|
|
86
122
|
}
|
|
87
123
|
|
|
88
124
|
export interface LabelOptions {
|
|
@@ -21,11 +21,10 @@ exports.levels = require('./levels');
|
|
|
21
21
|
* Exposes a sub-format on the main format object
|
|
22
22
|
* as a lazy-loaded getter.
|
|
23
23
|
*/
|
|
24
|
-
function exposeFormat(name,
|
|
25
|
-
path = path || name;
|
|
24
|
+
function exposeFormat(name, requireFormat) {
|
|
26
25
|
Object.defineProperty(format, name, {
|
|
27
26
|
get() {
|
|
28
|
-
return
|
|
27
|
+
return requireFormat();
|
|
29
28
|
},
|
|
30
29
|
configurable: true
|
|
31
30
|
});
|
|
@@ -34,20 +33,20 @@ function exposeFormat(name, path) {
|
|
|
34
33
|
//
|
|
35
34
|
// Setup all transports as lazy-loaded getters.
|
|
36
35
|
//
|
|
37
|
-
exposeFormat('align');
|
|
38
|
-
exposeFormat('errors');
|
|
39
|
-
exposeFormat('cli');
|
|
40
|
-
exposeFormat('combine');
|
|
41
|
-
exposeFormat('colorize');
|
|
42
|
-
exposeFormat('json');
|
|
43
|
-
exposeFormat('label');
|
|
44
|
-
exposeFormat('logstash');
|
|
45
|
-
exposeFormat('metadata');
|
|
46
|
-
exposeFormat('ms');
|
|
47
|
-
exposeFormat('padLevels', 'pad-levels');
|
|
48
|
-
exposeFormat('prettyPrint', 'pretty-print');
|
|
49
|
-
exposeFormat('printf');
|
|
50
|
-
exposeFormat('simple');
|
|
51
|
-
exposeFormat('splat');
|
|
52
|
-
exposeFormat('timestamp');
|
|
53
|
-
exposeFormat('uncolorize');
|
|
36
|
+
exposeFormat('align', function () { return require('./align'); });
|
|
37
|
+
exposeFormat('errors', function () { return require('./errors'); });
|
|
38
|
+
exposeFormat('cli', function () { return require('./cli'); });
|
|
39
|
+
exposeFormat('combine', function () { return require('./combine'); });
|
|
40
|
+
exposeFormat('colorize', function () { return require('./colorize'); });
|
|
41
|
+
exposeFormat('json', function () { return require('./json'); });
|
|
42
|
+
exposeFormat('label', function () { return require('./label'); });
|
|
43
|
+
exposeFormat('logstash', function () { return require('./logstash'); });
|
|
44
|
+
exposeFormat('metadata', function () { return require('./metadata'); });
|
|
45
|
+
exposeFormat('ms', function () { return require('./ms'); });
|
|
46
|
+
exposeFormat('padLevels', function () { return require('./pad-levels'); });
|
|
47
|
+
exposeFormat('prettyPrint', function () { return require('./pretty-print'); });
|
|
48
|
+
exposeFormat('printf', function () { return require('./printf'); });
|
|
49
|
+
exposeFormat('simple', function () { return require('./simple'); });
|
|
50
|
+
exposeFormat('splat', function () { return require('./splat'); });
|
|
51
|
+
exposeFormat('timestamp', function () { return require('./timestamp'); });
|
|
52
|
+
exposeFormat('uncolorize', function () { return require('./uncolorize'); });
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
const format = require('./format');
|
|
4
4
|
const { MESSAGE } = require('triple-beam');
|
|
5
|
-
const
|
|
5
|
+
const stringify = require('safe-stable-stringify');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* function replacer (key, value)
|
|
9
9
|
* Handles proper stringification of Buffer and bigint output.
|
|
10
10
|
*/
|
|
11
11
|
function replacer(key, value) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
12
|
+
// safe-stable-stringify does support BigInt, however, it doesn't wrap the value in quotes.
|
|
13
|
+
// Leading to a loss in fidelity if the resulting string is parsed.
|
|
14
|
+
// It would also be a breaking change for logform.
|
|
15
15
|
if (typeof value === 'bigint')
|
|
16
16
|
return value.toString();
|
|
17
17
|
return value;
|
|
@@ -23,8 +23,8 @@ function replacer(key, value) {
|
|
|
23
23
|
* object into pure JSON. This was previously exposed as { json: true }
|
|
24
24
|
* to transports in `winston < 3.0.0`.
|
|
25
25
|
*/
|
|
26
|
-
module.exports = format((info, opts
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
module.exports = format((info, opts) => {
|
|
27
|
+
const jsonStringify = stringify.configure(opts);
|
|
28
|
+
info[MESSAGE] = jsonStringify(info, opts.replacer || replacer, opts.space);
|
|
29
29
|
return info;
|
|
30
30
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "logform",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "An mutable object-based log format designed for chaining & objectMode streams.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"browser": "dist/browser.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"lint": "
|
|
8
|
+
"lint": "eslint *.js test/*.js examples/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",
|
|
9
9
|
"pretest": "npm run lint && npm run build",
|
|
10
10
|
"test": "nyc mocha test/*.test.js",
|
|
11
11
|
"build": "rimraf dist && babel *.js -d ./dist",
|
|
@@ -28,25 +28,26 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/winstonjs/logform#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"colors": "
|
|
32
|
-
"fast-safe-stringify": "^2.0.4",
|
|
31
|
+
"@colors/colors": "1.5.0",
|
|
33
32
|
"fecha": "^4.2.0",
|
|
34
33
|
"ms": "^2.1.1",
|
|
34
|
+
"safe-stable-stringify": "^2.3.1",
|
|
35
35
|
"triple-beam": "^1.3.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@babel/cli": "^7.10.3",
|
|
39
39
|
"@babel/core": "^7.10.3",
|
|
40
40
|
"@babel/preset-env": "^7.10.3",
|
|
41
|
+
"@dabh/eslint-config-populist": "^5.0.0",
|
|
41
42
|
"assume": "^2.2.0",
|
|
42
|
-
"eslint
|
|
43
|
-
"mocha": "^
|
|
43
|
+
"eslint": "^8.8.0",
|
|
44
|
+
"mocha": "^9.2.0",
|
|
44
45
|
"nyc": "^15.1.0",
|
|
45
46
|
"rimraf": "^3.0.2"
|
|
46
47
|
},
|
|
47
48
|
"types": "./index.d.ts"
|
|
48
49
|
|
|
49
|
-
,"_resolved": "https://registry.npmjs.org/logform/-/logform-2.
|
|
50
|
-
,"_integrity": "sha512-
|
|
51
|
-
,"_from": "logform@2.
|
|
50
|
+
,"_resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz"
|
|
51
|
+
,"_integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw=="
|
|
52
|
+
,"_from": "logform@2.4.0"
|
|
52
53
|
}
|