nestjs-pino 3.1.3 → 3.2.0-alpha.be50da
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/PinoLogger.d.ts +17 -3
- package/package.json +1 -1
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
|
}
|