@edirect/logger 11.0.40 → 11.0.42
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 +57 -40
- package/dist/README.md +57 -40
- package/dist/package.json +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,62 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
# @edirect/logger
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
<img src="https://img.shields.io/badge/nestjs-9-E3514D?style=for-the-badge&logo=nestjs">
|
|
3
|
+
Advanced logging module for Edirect applications. Provides structured, multi-level logging with support for file output, async configuration, and integration with NestJS and Edirect config modules.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## Features
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
- Multi-level logging (log, info, warn, error, debug, verbose)
|
|
8
|
+
- File and console output
|
|
9
|
+
- Async configuration with ConfigService
|
|
10
|
+
- Integrates with NestJS
|
|
9
11
|
|
|
10
12
|
## Installation
|
|
11
13
|
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
+
```bash
|
|
15
|
+
npm install @edirect/logger
|
|
14
16
|
```
|
|
15
17
|
|
|
16
18
|
## Usage
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
Register LoggerModule in your AppModule:
|
|
19
21
|
|
|
20
22
|
```typescript
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
import { LoggerModule } from '@edirect/logger';
|
|
24
|
+
|
|
25
|
+
@Module({
|
|
26
|
+
imports: [
|
|
27
|
+
LoggerModule.register({
|
|
28
|
+
output: 'output',
|
|
29
|
+
logs: {
|
|
30
|
+
errorFile: 'error_file',
|
|
31
|
+
warningFile: 'warning_file',
|
|
32
|
+
infoFile: 'info_file',
|
|
33
|
+
},
|
|
34
|
+
name: 'subscription-service',
|
|
35
|
+
}),
|
|
36
|
+
],
|
|
37
|
+
})
|
|
38
|
+
export class AppModule {}
|
|
34
39
|
```
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
Or use async configuration:
|
|
37
42
|
|
|
38
43
|
```typescript
|
|
39
44
|
import { ConfigService } from '@edirect/config';
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
46
|
+
@Module({
|
|
47
|
+
imports: [
|
|
48
|
+
LoggerModule.registerAsync({
|
|
49
|
+
imports: [ConfigModule],
|
|
50
|
+
useFactory: async (configService: ConfigService) => ({
|
|
51
|
+
output: configService.get(Variables.LOGS_OUTPUT),
|
|
52
|
+
logs: {
|
|
53
|
+
errorFile: configService.get(Variables.LOGS_ERROR_FILE),
|
|
54
|
+
warningFile: configService.get(Variables.LOGS_WARNING_FILE),
|
|
55
|
+
infoFile: configService.get(Variables.LOGS_INFO_FILE),
|
|
56
|
+
},
|
|
57
|
+
name: 'subscription-service',
|
|
58
|
+
}),
|
|
59
|
+
inject: [ConfigService],
|
|
55
60
|
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
export class AppModule {}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Inject LoggerService and use logging methods:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
constructor(private loggerService: LoggerService) {}
|
|
70
|
+
|
|
71
|
+
this.loggerService.log('message', payload);
|
|
72
|
+
this.loggerService.info('message', payload);
|
|
73
|
+
this.loggerService.warn('message', payload);
|
|
74
|
+
this.loggerService.error('message', trace);
|
|
75
|
+
this.loggerService.debug('message');
|
|
76
|
+
this.loggerService.verbose('message');
|
|
60
77
|
```
|
|
61
78
|
|
|
62
79
|
Inject the LoggerService where needed:
|
package/dist/README.md
CHANGED
|
@@ -1,62 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
# @edirect/logger
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
<img src="https://img.shields.io/badge/nestjs-9-E3514D?style=for-the-badge&logo=nestjs">
|
|
3
|
+
Advanced logging module for Edirect applications. Provides structured, multi-level logging with support for file output, async configuration, and integration with NestJS and Edirect config modules.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## Features
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
- Multi-level logging (log, info, warn, error, debug, verbose)
|
|
8
|
+
- File and console output
|
|
9
|
+
- Async configuration with ConfigService
|
|
10
|
+
- Integrates with NestJS
|
|
9
11
|
|
|
10
12
|
## Installation
|
|
11
13
|
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
+
```bash
|
|
15
|
+
npm install @edirect/logger
|
|
14
16
|
```
|
|
15
17
|
|
|
16
18
|
## Usage
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
Register LoggerModule in your AppModule:
|
|
19
21
|
|
|
20
22
|
```typescript
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
import { LoggerModule } from '@edirect/logger';
|
|
24
|
+
|
|
25
|
+
@Module({
|
|
26
|
+
imports: [
|
|
27
|
+
LoggerModule.register({
|
|
28
|
+
output: 'output',
|
|
29
|
+
logs: {
|
|
30
|
+
errorFile: 'error_file',
|
|
31
|
+
warningFile: 'warning_file',
|
|
32
|
+
infoFile: 'info_file',
|
|
33
|
+
},
|
|
34
|
+
name: 'subscription-service',
|
|
35
|
+
}),
|
|
36
|
+
],
|
|
37
|
+
})
|
|
38
|
+
export class AppModule {}
|
|
34
39
|
```
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
Or use async configuration:
|
|
37
42
|
|
|
38
43
|
```typescript
|
|
39
44
|
import { ConfigService } from '@edirect/config';
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
46
|
+
@Module({
|
|
47
|
+
imports: [
|
|
48
|
+
LoggerModule.registerAsync({
|
|
49
|
+
imports: [ConfigModule],
|
|
50
|
+
useFactory: async (configService: ConfigService) => ({
|
|
51
|
+
output: configService.get(Variables.LOGS_OUTPUT),
|
|
52
|
+
logs: {
|
|
53
|
+
errorFile: configService.get(Variables.LOGS_ERROR_FILE),
|
|
54
|
+
warningFile: configService.get(Variables.LOGS_WARNING_FILE),
|
|
55
|
+
infoFile: configService.get(Variables.LOGS_INFO_FILE),
|
|
56
|
+
},
|
|
57
|
+
name: 'subscription-service',
|
|
58
|
+
}),
|
|
59
|
+
inject: [ConfigService],
|
|
55
60
|
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
export class AppModule {}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Inject LoggerService and use logging methods:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
constructor(private loggerService: LoggerService) {}
|
|
70
|
+
|
|
71
|
+
this.loggerService.log('message', payload);
|
|
72
|
+
this.loggerService.info('message', payload);
|
|
73
|
+
this.loggerService.warn('message', payload);
|
|
74
|
+
this.loggerService.error('message', trace);
|
|
75
|
+
this.loggerService.debug('message');
|
|
76
|
+
this.loggerService.verbose('message');
|
|
60
77
|
```
|
|
61
78
|
|
|
62
79
|
Inject the LoggerService where needed:
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edirect/logger",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.41",
|
|
4
4
|
"main": "./dist/src/index.js",
|
|
5
5
|
"types": "./dist/src/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@edirect/config": "^11.0.
|
|
19
|
+
"@edirect/config": "^11.0.41",
|
|
20
20
|
"@nestjs/common": "^11.1.12",
|
|
21
|
-
"pino": "10.
|
|
21
|
+
"pino": "10.3.0",
|
|
22
22
|
"supertest": "7.2.2",
|
|
23
23
|
"tslib": "^2.8.1"
|
|
24
24
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edirect/logger",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.42",
|
|
4
4
|
"packageScope": "@edirect",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@nestjs/common": "^11.1.12",
|
|
21
|
-
"pino": "10.
|
|
21
|
+
"pino": "10.3.0",
|
|
22
22
|
"supertest": "7.2.2",
|
|
23
23
|
"tslib": "^2.8.1",
|
|
24
|
-
"@edirect/config": "11.0.
|
|
24
|
+
"@edirect/config": "11.0.42"
|
|
25
25
|
},
|
|
26
26
|
"nx": {
|
|
27
27
|
"name": "@edirect/logger",
|