@companieshouse/structured-logging-node 2.0.3 → 2.0.5
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/README.md
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Structured logger for Node.JS applications
|
|
4
4
|
|
|
5
|
+
## Compatible Node.js Versions
|
|
6
|
+
|
|
7
|
+
This package has been upgraded to be compatible with Node v24. Presently, it's backward compatible with v20 and v18 but compatibility is primarily required for v24 as all CH Node services are in the process of being upgraded to v24.
|
|
8
|
+
|
|
5
9
|
## Environment variables
|
|
6
10
|
|
|
7
11
|
`LOG_LEVEL` - specifies logging level threshold (values: see https://github.com/winstonjs/winston#logging-levels; default: `info`)
|
|
8
12
|
|
|
9
|
-
`HUMAN_LOG` - prints logs in plain text format (values: `1` / `0`; default: `0`)
|
|
13
|
+
`HUMAN_LOG` - prints logs in plain text format (values: `1` / `0`; default: `0`)
|
|
@@ -22,7 +22,7 @@ class HumanFormatFactory {
|
|
|
22
22
|
span_id: info.span_id,
|
|
23
23
|
trace_flags: info.trace_flags
|
|
24
24
|
};
|
|
25
|
-
const keys = Object.keys(messageInfo).sort();
|
|
25
|
+
const keys = Object.keys(messageInfo).sort((currentKey, nextKey) => currentKey.localeCompare(nextKey));
|
|
26
26
|
let message = colorizer.colorize(info.level, `${messageInfo.created} ${messageInfo.event}: ${info.message}`);
|
|
27
27
|
keys.forEach(function (key) {
|
|
28
28
|
if (messageInfo[key] !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HumanFormatFactory.js","sourceRoot":"","sources":["../../src/formatting/HumanFormatFactory.ts"],"names":[],"mappings":";;;;AACA,oDAA4B;AAC5B,sDAA8B;AAE9B,MAAM,kBAAkB;IAEb,MAAM,CAAC,MAAM,CAAC,SAAiB;QAElC,MAAM,SAAS,GAAG,iBAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAE5C,OAAO,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B,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,WAAW,EAAE,IAAI,CAAC,WAAW;aAChC,CAAC;YAEF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YAEvG,IAAI,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,IAAI,WAAW,CAAC,KAAK,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAE7G,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG;gBACtB,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;oBAChC,OAAO,IAAI,UAAU,GAAG,KAAK,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;iBACnD;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,iBAAS,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companieshouse/structured-logging-node",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "A logging solution for CHS structured logging in node apps.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -32,28 +32,28 @@
|
|
|
32
32
|
"winston": "~3.3.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/chai": "~4.2.
|
|
35
|
+
"@types/chai": "~4.2.22",
|
|
36
36
|
"@types/express": "~4.17.8",
|
|
37
|
-
"@types/mocha": "~
|
|
37
|
+
"@types/mocha": "~10.0.6",
|
|
38
38
|
"@types/on-finished": "~2.3.1",
|
|
39
|
-
"@types/
|
|
39
|
+
"@types/sinon": "^17.0.4",
|
|
40
40
|
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
|
41
41
|
"@typescript-eslint/parser": "^5.54.1",
|
|
42
42
|
"chai": "~4.2.0",
|
|
43
|
-
"eslint": "^
|
|
44
|
-
"eslint-config-standard": "
|
|
43
|
+
"eslint": "^8.47.0",
|
|
44
|
+
"eslint-config-standard": "^17.1.0",
|
|
45
45
|
"eslint-plugin-chai-friendly": "~0.6.0",
|
|
46
|
-
"eslint-plugin-import": "2.
|
|
46
|
+
"eslint-plugin-import": "2.27.5",
|
|
47
47
|
"eslint-plugin-node": "11.1.0",
|
|
48
48
|
"eslint-plugin-promise": "6.0.0",
|
|
49
49
|
"eslint-plugin-standard": "5.0.0",
|
|
50
|
-
"mocha": "^11.
|
|
50
|
+
"mocha": "^11.7.2",
|
|
51
51
|
"mockdate": "~3.0.2",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
52
|
+
"nyc": "^17.1.0",
|
|
53
|
+
"sinon": "^21.0.0",
|
|
54
|
+
"sonarqube-scanner": "^3.0.5",
|
|
54
55
|
"ts-node": "^10.8.1",
|
|
55
|
-
"typescript": "^4.1.6"
|
|
56
|
-
"nyc": "^15.1.0"
|
|
56
|
+
"typescript": "^4.1.6"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
59
|
"lib/**/*"
|