@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 CHANGED
@@ -1,62 +1,79 @@
1
- <!-- https://simpleicons.org/ -->
1
+ # @edirect/logger
2
2
 
3
- <img src="https://img.shields.io/badge/version-9.1.1-00bac7?style=for-the-badge">&nbsp;
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
- # @edirect/logger
5
+ ## Features
7
6
 
8
- The EDirectInsure Logger module.
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
- ```shell
13
- $ npm i --save @edirect/logger
14
+ ```bash
15
+ npm install @edirect/logger
14
16
  ```
15
17
 
16
18
  ## Usage
17
19
 
18
- Import and register LoggerModule on AppModule (app.module.ts):
20
+ Register LoggerModule in your AppModule:
19
21
 
20
22
  ```typescript
21
- imports: [
22
- ...
23
- LoggerModule.register({
24
- output: "output",
25
- logs: {
26
- errorFile: "error_file",
27
- warningFile: "warning_file",
28
- infoFile: "info_file",
29
- },
30
- name: 'subscription-service',
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
- OR
41
+ Or use async configuration:
37
42
 
38
43
  ```typescript
39
44
  import { ConfigService } from '@edirect/config';
40
45
 
41
- ...
42
-
43
- imports: [
44
- ...
45
- LoggerModule.registerAsync({
46
- imports: [ConfigModule],
47
- useFactory: async (configService: ConfigService) => ({
48
- output: configService.get(Variables.LOGS_OUTPUT),
49
- logs: {
50
- errorFile: configService.get(Variables.LOGS_ERROR_FILE),
51
- warningFile: configService.get(Variables.LOGS_WARNING_FILE),
52
- infoFile: configService.get(Variables.LOGS_INFO_FILE),
53
- },
54
- name: 'subscription-service',
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
- inject: [ConfigService],
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
- <!-- https://simpleicons.org/ -->
1
+ # @edirect/logger
2
2
 
3
- <img src="https://img.shields.io/badge/version-9.1.1-00bac7?style=for-the-badge">&nbsp;
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
- # @edirect/logger
5
+ ## Features
7
6
 
8
- The EDirectInsure Logger module.
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
- ```shell
13
- $ npm i --save @edirect/logger
14
+ ```bash
15
+ npm install @edirect/logger
14
16
  ```
15
17
 
16
18
  ## Usage
17
19
 
18
- Import and register LoggerModule on AppModule (app.module.ts):
20
+ Register LoggerModule in your AppModule:
19
21
 
20
22
  ```typescript
21
- imports: [
22
- ...
23
- LoggerModule.register({
24
- output: "output",
25
- logs: {
26
- errorFile: "error_file",
27
- warningFile: "warning_file",
28
- infoFile: "info_file",
29
- },
30
- name: 'subscription-service',
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
- OR
41
+ Or use async configuration:
37
42
 
38
43
  ```typescript
39
44
  import { ConfigService } from '@edirect/config';
40
45
 
41
- ...
42
-
43
- imports: [
44
- ...
45
- LoggerModule.registerAsync({
46
- imports: [ConfigModule],
47
- useFactory: async (configService: ConfigService) => ({
48
- output: configService.get(Variables.LOGS_OUTPUT),
49
- logs: {
50
- errorFile: configService.get(Variables.LOGS_ERROR_FILE),
51
- warningFile: configService.get(Variables.LOGS_WARNING_FILE),
52
- infoFile: configService.get(Variables.LOGS_INFO_FILE),
53
- },
54
- name: 'subscription-service',
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
- inject: [ConfigService],
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.40",
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.40",
19
+ "@edirect/config": "^11.0.41",
20
20
  "@nestjs/common": "^11.1.12",
21
- "pino": "10.2.0",
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.40",
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.2.0",
21
+ "pino": "10.3.0",
22
22
  "supertest": "7.2.2",
23
23
  "tslib": "^2.8.1",
24
- "@edirect/config": "11.0.40"
24
+ "@edirect/config": "11.0.42"
25
25
  },
26
26
  "nx": {
27
27
  "name": "@edirect/logger",