nestjs-pino 4.2.0 → 4.3.0-alpha.89de3e
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/LoggerModule.js +5 -4
- package/PinoLogger.js +1 -3
- package/README.md +8 -7
- package/package.json +29 -25
- package/postinstall.js +2 -2
package/LoggerModule.js
CHANGED
|
@@ -14,7 +14,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
var LoggerModule_1;
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.LoggerModule = void 0;
|
|
17
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
17
|
const common_1 = require("@nestjs/common");
|
|
19
18
|
const pino_http_1 = require("pino-http");
|
|
20
19
|
const InjectPinoLogger_1 = require("./InjectPinoLogger");
|
|
@@ -22,6 +21,11 @@ const Logger_1 = require("./Logger");
|
|
|
22
21
|
const params_1 = require("./params");
|
|
23
22
|
const PinoLogger_1 = require("./PinoLogger");
|
|
24
23
|
const storage_1 = require("./storage");
|
|
24
|
+
/**
|
|
25
|
+
* As NestJS@11 still supports express@4 `*`-style routing by itself let's keep
|
|
26
|
+
* it for the backward compatibility. On the next major NestJS release `*` we
|
|
27
|
+
* can replace it with `/{*splat}`, and drop the support for NestJS@9 and below.
|
|
28
|
+
*/
|
|
25
29
|
const DEFAULT_ROUTES = [{ path: '*', method: common_1.RequestMethod.ALL }];
|
|
26
30
|
let LoggerModule = LoggerModule_1 = class LoggerModule {
|
|
27
31
|
static forRoot(params) {
|
|
@@ -103,9 +107,6 @@ function bindLoggerMiddlewareFactory(useExisting, assignResponse) {
|
|
|
103
107
|
if (assignResponse && !useExisting && res.allLogs) {
|
|
104
108
|
resLog = res.allLogs[res.allLogs.length - 1];
|
|
105
109
|
}
|
|
106
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
107
|
-
// @ts-ignore: run requires arguments for next but should not because it can
|
|
108
|
-
// be called without arguments
|
|
109
110
|
storage_1.storage.run(new storage_1.Store(log, resLog), next);
|
|
110
111
|
};
|
|
111
112
|
}
|
package/PinoLogger.js
CHANGED
|
@@ -16,7 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.PinoLogger = void 0;
|
|
17
17
|
exports.__resetOutOfContextForTests = __resetOutOfContextForTests;
|
|
18
18
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
19
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
20
19
|
const common_1 = require("@nestjs/common");
|
|
21
20
|
const pino_1 = require("pino");
|
|
22
21
|
const params_1 = require("./params");
|
|
@@ -57,9 +56,8 @@ let PinoLogger = PinoLogger_1 = class PinoLogger {
|
|
|
57
56
|
this.contextName = renameContext || 'context';
|
|
58
57
|
}
|
|
59
58
|
get logger() {
|
|
60
|
-
var _a;
|
|
61
59
|
// outOfContext is always set in runtime before starts using
|
|
62
|
-
|
|
60
|
+
var _a;
|
|
63
61
|
return ((_a = storage_1.storage.getStore()) === null || _a === void 0 ? void 0 : _a.logger) || outOfContext;
|
|
64
62
|
}
|
|
65
63
|
trace(...args) {
|
package/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img alt="
|
|
3
|
-
<br/>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<img alt="Bombed Vovchansk, Ukraine" src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Vovchansk_%282024-06-02%29_1513.jpg/640px-Vovchansk_%282024-06-02%29_1513.jpg"/>
|
|
3
|
+
<br />
|
|
4
|
+
<small>"Vovchansk (2024-06-02) 1513" by National Police of Ukraine (Liut Brigade) is licensed under CC BY 4.0.</small>
|
|
5
|
+
</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
This is Vovchansk, Ukraine, the city where the father of this library’s author was born. This is how it looks now, after the Russian invasion. If you find this library useful and would like to thank the author, please consider donating any amount via one of the following links:
|
|
7
8
|
<br/>
|
|
8
|
-
・<a href="https://war.ukraine.ua/donate/">Armed Forces of Ukraine</a>・<a href="https://
|
|
9
|
+
・<a href="https://war.ukraine.ua/donate/">Armed Forces of Ukraine</a>・<a href="https://savelife.in.ua/en/">"The Come Back Alive" foundation</a>・
|
|
9
10
|
<br/>
|
|
10
|
-
Thanks for your support!
|
|
11
|
+
Thanks for your support! 🇺🇦
|
|
11
12
|
</p>
|
|
12
13
|
|
|
13
14
|
<h1 align="center">NestJS-Pino</h1>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-pino",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-alpha.89de3e",
|
|
4
4
|
"description": "Pino logger for NestJS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -41,38 +41,42 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/iamolegga/nestjs-pino#readme",
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@nestjs/
|
|
48
|
-
"@nestjs/
|
|
44
|
+
"@eslint/compat": "^1.2.5",
|
|
45
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
46
|
+
"@eslint/js": "^9.18.0",
|
|
47
|
+
"@nestjs/common": "^11.0.3",
|
|
48
|
+
"@nestjs/core": "^11.0.3",
|
|
49
|
+
"@nestjs/platform-express": "^11.0.3",
|
|
50
|
+
"@nestjs/platform-fastify": "^11.0.3",
|
|
51
|
+
"@nestjs/testing": "^11.0.3",
|
|
49
52
|
"@types/express": "^5.0.0",
|
|
50
|
-
"@types/jest": "^29.5.
|
|
51
|
-
"@types/memorystream": "^0.3.
|
|
52
|
-
"@types/node": "^22.
|
|
53
|
+
"@types/jest": "^29.5.14",
|
|
54
|
+
"@types/memorystream": "^0.3.4",
|
|
55
|
+
"@types/node": "^22.10.7",
|
|
53
56
|
"@types/supertest": "^6.0.2",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
55
|
-
"@typescript-eslint/parser": "^
|
|
56
|
-
"eslint": "^
|
|
57
|
-
"eslint-config-prettier": "^
|
|
58
|
-
"eslint-plugin-import": "^2.
|
|
59
|
-
"eslint-plugin-prettier": "^5.
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
|
58
|
+
"@typescript-eslint/parser": "^8.21.0",
|
|
59
|
+
"eslint": "^9.18.0",
|
|
60
|
+
"eslint-config-prettier": "^10.0.1",
|
|
61
|
+
"eslint-plugin-import": "^2.31.0",
|
|
62
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
63
|
+
"globals": "^15.14.0",
|
|
60
64
|
"jest": "29.7.0",
|
|
61
65
|
"memorystream": "^0.3.1",
|
|
62
|
-
"pino": "^9.
|
|
63
|
-
"pino-http": "^10.
|
|
64
|
-
"prettier": "^3.
|
|
65
|
-
"reflect-metadata": "^0.1.
|
|
66
|
-
"rimraf": "^6.0.
|
|
66
|
+
"pino": "^9.6.0",
|
|
67
|
+
"pino-http": "^10.4.0",
|
|
68
|
+
"prettier": "^3.4.2",
|
|
69
|
+
"reflect-metadata": "^0.1.14",
|
|
70
|
+
"rimraf": "^6.0.1",
|
|
67
71
|
"rxjs": "^7.8.1",
|
|
68
72
|
"supertest": "^7.0.0",
|
|
69
|
-
"ts-jest": "^29.
|
|
70
|
-
"ts-loader": "^9.
|
|
71
|
-
"ts-node": "^10.9.
|
|
72
|
-
"typescript": "^5.
|
|
73
|
+
"ts-jest": "^29.2.5",
|
|
74
|
+
"ts-loader": "^9.5.2",
|
|
75
|
+
"ts-node": "^10.9.2",
|
|
76
|
+
"typescript": "^5.7.3"
|
|
73
77
|
},
|
|
74
78
|
"peerDependencies": {
|
|
75
|
-
"@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0",
|
|
79
|
+
"@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",
|
|
76
80
|
"pino-http": "^6.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0"
|
|
77
81
|
}
|
|
78
82
|
}
|
package/postinstall.js
CHANGED
|
@@ -9,10 +9,10 @@ console.log(`
|
|
|
9
9
|
\t\tbombed cities (including schools, hospitals, etc), hundreds of killed children, millions of refugees.
|
|
10
10
|
\t\tSo if you enjoy this library you can thank the author by donating to one of this funds:
|
|
11
11
|
\t\t• https://war.ukraine.ua/donate/ – Armed Forces of Ukraine
|
|
12
|
-
\t\t• https://
|
|
12
|
+
\t\t• https://savelife.in.ua/en/ – "The Come Back Alive" foundation
|
|
13
13
|
|
|
14
14
|
\t\tThanks for your support! 🇺🇦
|
|
15
15
|
|
|
16
16
|
`);
|
|
17
17
|
|
|
18
|
-
new Promise(r => setTimeout(r, 5000));
|
|
18
|
+
new Promise((r) => setTimeout(r, 5000));
|