@saihu/common 1.1.47 → 1.1.48
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LoggerService } from '@nestjs/common';
|
|
2
2
|
export declare class SaihuLogger implements LoggerService {
|
|
3
|
+
private shouldHideContext;
|
|
3
4
|
log(message: any, context?: string): void;
|
|
4
5
|
error(message: any, trace?: string, context?: string): void;
|
|
5
6
|
warn(message: any, context?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saihu-logger.service.d.ts","sourceRoot":"","sources":["../../src/logger/saihu-logger.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBAAa,WAAY,YAAW,aAAa;IAC/C,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"saihu-logger.service.d.ts","sourceRoot":"","sources":["../../src/logger/saihu-logger.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBAAa,WAAY,YAAW,aAAa;IAC/C,OAAO,CAAC,iBAAiB;IAqBzB,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM;IAKlC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAKpD,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM;IAKnC,KAAK;IACL,OAAO;CACR"}
|
|
@@ -2,83 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SaihuLogger = void 0;
|
|
4
4
|
class SaihuLogger {
|
|
5
|
+
shouldHideContext(context) {
|
|
6
|
+
if (!context)
|
|
7
|
+
return false;
|
|
8
|
+
const hiddenContexts = [
|
|
9
|
+
'InstanceLoader',
|
|
10
|
+
'RoutesResolver',
|
|
11
|
+
'RouterExplorer',
|
|
12
|
+
'NestFactory',
|
|
13
|
+
'NestApplication',
|
|
14
|
+
'ClientProxy',
|
|
15
|
+
'NestMicroservice',
|
|
16
|
+
'AmqpConnection',
|
|
17
|
+
'MicroserviceConfiguration',
|
|
18
|
+
'RabbitMQModule',
|
|
19
|
+
'WebSocketsController',
|
|
20
|
+
'ExceptionsHandler', // ← Add this
|
|
21
|
+
];
|
|
22
|
+
return hiddenContexts.some((hidden) => context.includes(hidden));
|
|
23
|
+
}
|
|
5
24
|
log(message, context) {
|
|
6
|
-
|
|
7
|
-
if (context === null || context === void 0 ? void 0 : context.includes('InstanceLoader'))
|
|
8
|
-
return;
|
|
9
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RoutesResolver'))
|
|
10
|
-
return;
|
|
11
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RouterExplorer'))
|
|
12
|
-
return;
|
|
13
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestFactory'))
|
|
14
|
-
return;
|
|
15
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestApplication'))
|
|
16
|
-
return;
|
|
17
|
-
if (context === null || context === void 0 ? void 0 : context.includes('ClientProxy'))
|
|
18
|
-
return;
|
|
19
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestMicroservice'))
|
|
20
|
-
return;
|
|
21
|
-
if (context === null || context === void 0 ? void 0 : context.includes('AmqpConnection'))
|
|
22
|
-
return;
|
|
23
|
-
if (context === null || context === void 0 ? void 0 : context.includes('MicroserviceConfiguration'))
|
|
24
|
-
return;
|
|
25
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RabbitMQModule'))
|
|
26
|
-
return;
|
|
27
|
-
if (context === null || context === void 0 ? void 0 : context.includes('WebSocketsController'))
|
|
28
|
-
return;
|
|
29
|
-
if (context === null || context === void 0 ? void 0 : context.includes('ExceptionsHandler'))
|
|
25
|
+
if (this.shouldHideContext(context))
|
|
30
26
|
return;
|
|
31
27
|
console.log(`[${context}]`, message);
|
|
32
28
|
}
|
|
33
29
|
error(message, trace, context) {
|
|
34
|
-
|
|
35
|
-
if (context === null || context === void 0 ? void 0 : context.includes('InstanceLoader'))
|
|
36
|
-
return;
|
|
37
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RoutesResolver'))
|
|
38
|
-
return;
|
|
39
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RouterExplorer'))
|
|
40
|
-
return;
|
|
41
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestFactory'))
|
|
42
|
-
return;
|
|
43
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestApplication'))
|
|
44
|
-
return;
|
|
45
|
-
if (context === null || context === void 0 ? void 0 : context.includes('ClientProxy'))
|
|
46
|
-
return;
|
|
47
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestMicroservice'))
|
|
48
|
-
return;
|
|
49
|
-
if (context === null || context === void 0 ? void 0 : context.includes('AmqpConnection'))
|
|
50
|
-
return;
|
|
51
|
-
if (context === null || context === void 0 ? void 0 : context.includes('MicroserviceConfiguration'))
|
|
52
|
-
return;
|
|
53
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RabbitMQModule'))
|
|
54
|
-
return;
|
|
55
|
-
if (context === null || context === void 0 ? void 0 : context.includes('WebSocketsController'))
|
|
30
|
+
if (this.shouldHideContext(context))
|
|
56
31
|
return;
|
|
57
32
|
console.error(`[${context}]`, message, trace);
|
|
58
33
|
}
|
|
59
34
|
warn(message, context) {
|
|
60
|
-
|
|
61
|
-
if (context === null || context === void 0 ? void 0 : context.includes('InstanceLoader'))
|
|
62
|
-
return;
|
|
63
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RoutesResolver'))
|
|
64
|
-
return;
|
|
65
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RouterExplorer'))
|
|
66
|
-
return;
|
|
67
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestFactory'))
|
|
68
|
-
return;
|
|
69
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestApplication'))
|
|
70
|
-
return;
|
|
71
|
-
if (context === null || context === void 0 ? void 0 : context.includes('ClientProxy'))
|
|
72
|
-
return;
|
|
73
|
-
if (context === null || context === void 0 ? void 0 : context.includes('NestMicroservice'))
|
|
74
|
-
return;
|
|
75
|
-
if (context === null || context === void 0 ? void 0 : context.includes('AmqpConnection'))
|
|
76
|
-
return;
|
|
77
|
-
if (context === null || context === void 0 ? void 0 : context.includes('MicroserviceConfiguration'))
|
|
78
|
-
return;
|
|
79
|
-
if (context === null || context === void 0 ? void 0 : context.includes('RabbitMQModule'))
|
|
80
|
-
return;
|
|
81
|
-
if (context === null || context === void 0 ? void 0 : context.includes('WebSocketsController'))
|
|
35
|
+
if (this.shouldHideContext(context))
|
|
82
36
|
return;
|
|
83
37
|
console.warn(`[${context}]`, message);
|
|
84
38
|
}
|