nestjs-pino 3.1.2 → 3.1.3-alpha.52232a
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/InjectPinoLogger.d.ts +1 -1
- package/PinoLogger.d.ts +17 -3
- package/README.md +8 -3
- package/package.json +28 -28
package/InjectPinoLogger.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Provider } from '@nestjs/common';
|
|
2
2
|
import { PinoLogger } from './PinoLogger';
|
|
3
|
-
export declare function InjectPinoLogger(context?: string): (target: object, key: string | symbol, index?: number | undefined) => void;
|
|
3
|
+
export declare function InjectPinoLogger(context?: string): (target: object, key: string | symbol | undefined, index?: number | undefined) => void;
|
|
4
4
|
export declare function createProvidersForDecorated(): Array<Provider<PinoLogger>>;
|
|
5
5
|
export declare function getLoggerToken(context: string): string;
|
package/PinoLogger.d.ts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import pino from 'pino';
|
|
2
2
|
import { Params } from './params';
|
|
3
3
|
type PinoMethods = Pick<pino.Logger, 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>;
|
|
4
|
+
/**
|
|
5
|
+
* This is copy of pino.LogFn but with possibilty to make method override.
|
|
6
|
+
* Current usage works:
|
|
7
|
+
*
|
|
8
|
+
* trace(msg: string, ...args: any[]): void;
|
|
9
|
+
* trace(obj: object, msg?: string, ...args: any[]): void;
|
|
10
|
+
* trace(...args: Parameters<LoggerFn>) {
|
|
11
|
+
* this.call('trace', ...args);
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* But if change local LoggerFn to pino.LogFn – this will say that overrides
|
|
15
|
+
* are incompatible
|
|
16
|
+
*/
|
|
17
|
+
type LoggerFn = ((msg: string, ...args: any[]) => void) | ((obj: object, msg?: string, ...args: any[]) => void);
|
|
4
18
|
export declare function __resetOutOfContextForTests(): void;
|
|
5
19
|
export declare class PinoLogger implements PinoMethods {
|
|
6
20
|
/**
|
|
@@ -9,8 +23,8 @@ export declare class PinoLogger implements PinoMethods {
|
|
|
9
23
|
* Readonly, but you can change it's properties.
|
|
10
24
|
*/
|
|
11
25
|
static readonly root: pino.Logger;
|
|
12
|
-
|
|
13
|
-
|
|
26
|
+
protected context: string;
|
|
27
|
+
protected readonly contextName: string;
|
|
14
28
|
constructor({ pinoHttp, renameContext }: Params);
|
|
15
29
|
trace(msg: string, ...args: any[]): void;
|
|
16
30
|
trace(obj: unknown, msg?: string, ...args: any[]): void;
|
|
@@ -25,7 +39,7 @@ export declare class PinoLogger implements PinoMethods {
|
|
|
25
39
|
fatal(msg: string, ...args: any[]): void;
|
|
26
40
|
fatal(obj: unknown, msg?: string, ...args: any[]): void;
|
|
27
41
|
setContext(value: string): void;
|
|
28
|
-
|
|
42
|
+
protected call(method: pino.Level, ...args: Parameters<LoggerFn>): void;
|
|
29
43
|
get logger(): pino.Logger;
|
|
30
44
|
assign(fields: pino.Bindings): void;
|
|
31
45
|
}
|
package/README.md
CHANGED
|
@@ -175,7 +175,7 @@ The following interface is using for the configuration:
|
|
|
175
175
|
interface Params {
|
|
176
176
|
/**
|
|
177
177
|
* Optional parameters for `pino-http` module
|
|
178
|
-
* @see https://github.com/pinojs/pino-http#
|
|
178
|
+
* @see https://github.com/pinojs/pino-http#api
|
|
179
179
|
*/
|
|
180
180
|
pinoHttp?:
|
|
181
181
|
| pinoHttp.Options
|
|
@@ -242,8 +242,13 @@ import { LoggerModule } from 'nestjs-pino';
|
|
|
242
242
|
transport: process.env.NODE_ENV !== 'production'
|
|
243
243
|
? { target: 'pino-pretty' }
|
|
244
244
|
: undefined,
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
// and all the other fields of:
|
|
248
|
+
// - https://github.com/pinojs/pino-http#api
|
|
249
|
+
// - https://github.com/pinojs/pino/blob/HEAD/docs/api.md#options-object
|
|
250
|
+
|
|
251
|
+
|
|
247
252
|
},
|
|
248
253
|
someWritableStream
|
|
249
254
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestjs-pino",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3-alpha.52232a",
|
|
4
4
|
"description": "Pino logger for NestJS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -39,36 +39,36 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/iamolegga/nestjs-pino#readme",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@nestjs/common": "^9.0
|
|
43
|
-
"@nestjs/core": "^9.0
|
|
44
|
-
"@nestjs/platform-express": "^9.0
|
|
45
|
-
"@nestjs/platform-fastify": "^9.0
|
|
46
|
-
"@nestjs/testing": "^9.0
|
|
47
|
-
"@types/express": "^4.17.
|
|
48
|
-
"@types/jest": "^
|
|
49
|
-
"@types/memorystream": "^0.3.
|
|
50
|
-
"@types/node": "^18.
|
|
51
|
-
"@types/supertest": "^2.0.
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
53
|
-
"@typescript-eslint/parser": "^5.
|
|
54
|
-
"eslint": "^8.
|
|
55
|
-
"eslint-config-prettier": "^8.
|
|
56
|
-
"eslint-plugin-import": "^2.
|
|
57
|
-
"eslint-plugin-prettier": "^4.
|
|
58
|
-
"jest": "
|
|
42
|
+
"@nestjs/common": "^9.4.0",
|
|
43
|
+
"@nestjs/core": "^9.4.0",
|
|
44
|
+
"@nestjs/platform-express": "^9.4.0",
|
|
45
|
+
"@nestjs/platform-fastify": "^9.4.0",
|
|
46
|
+
"@nestjs/testing": "^9.4.0",
|
|
47
|
+
"@types/express": "^4.17.17",
|
|
48
|
+
"@types/jest": "^29.5.0",
|
|
49
|
+
"@types/memorystream": "^0.3.1",
|
|
50
|
+
"@types/node": "^18.15.11",
|
|
51
|
+
"@types/supertest": "^2.0.12",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
53
|
+
"@typescript-eslint/parser": "^5.59.0",
|
|
54
|
+
"eslint": "^8.38.0",
|
|
55
|
+
"eslint-config-prettier": "^8.8.0",
|
|
56
|
+
"eslint-plugin-import": "^2.27.5",
|
|
57
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
58
|
+
"jest": "29.5.0",
|
|
59
59
|
"memorystream": "^0.3.1",
|
|
60
|
-
"pino": "^8.
|
|
61
|
-
"pino-http": "^8.3.
|
|
62
|
-
"prettier": "^2.
|
|
60
|
+
"pino": "^8.11.0",
|
|
61
|
+
"pino-http": "^8.3.3",
|
|
62
|
+
"prettier": "^2.8.7",
|
|
63
63
|
"reflect-metadata": "^0.1.13",
|
|
64
|
-
"rimraf": "^
|
|
65
|
-
"rxjs": "^7.
|
|
66
|
-
"supertest": "^6.
|
|
67
|
-
"ts-jest": "^
|
|
68
|
-
"ts-loader": "^9.2
|
|
69
|
-
"ts-node": "^10.
|
|
64
|
+
"rimraf": "^5.0.0",
|
|
65
|
+
"rxjs": "^7.8.0",
|
|
66
|
+
"supertest": "^6.3.3",
|
|
67
|
+
"ts-jest": "^29.1.0",
|
|
68
|
+
"ts-loader": "^9.4.2",
|
|
69
|
+
"ts-node": "^10.9.1",
|
|
70
70
|
"tslint": "^6.0.0",
|
|
71
|
-
"typescript": "^
|
|
71
|
+
"typescript": "^5.0.4"
|
|
72
72
|
},
|
|
73
73
|
"jest": {
|
|
74
74
|
"moduleFileExtensions": [
|