@wgtechlabs/log-engine 2.0.0 → 2.1.1
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/LICENSE +21 -21
- package/README.md +869 -608
- package/dist/cjs/__tests__/async-test-utils.cjs +276 -0
- package/dist/cjs/__tests__/async-test-utils.d.ts +51 -0
- package/dist/cjs/__tests__/async-test-utils.d.ts.map +1 -0
- package/dist/cjs/__tests__/async-test-utils.js.map +1 -0
- package/dist/cjs/__tests__/redaction/test-utils.cjs +72 -0
- package/dist/cjs/__tests__/redaction/test-utils.d.ts +33 -0
- package/dist/cjs/__tests__/redaction/test-utils.d.ts.map +1 -0
- package/dist/cjs/__tests__/redaction/test-utils.js.map +1 -0
- package/dist/cjs/__tests__/test-utils.cjs +49 -0
- package/dist/cjs/__tests__/test-utils.d.ts +41 -0
- package/dist/cjs/__tests__/test-utils.d.ts.map +1 -0
- package/dist/cjs/__tests__/test-utils.js.map +1 -0
- package/dist/{formatter/colors.js → cjs/formatter/colors.cjs} +1 -0
- package/dist/cjs/formatter/colors.d.ts.map +1 -0
- package/dist/cjs/formatter/colors.js.map +1 -0
- package/dist/{formatter/data-formatter.js → cjs/formatter/data-formatter.cjs} +2 -1
- package/dist/{formatter → cjs/formatter}/data-formatter.d.ts +2 -1
- package/dist/cjs/formatter/data-formatter.d.ts.map +1 -0
- package/dist/cjs/formatter/data-formatter.js.map +1 -0
- package/dist/{formatter/index.js → cjs/formatter/index.cjs} +6 -5
- package/dist/cjs/formatter/index.d.ts.map +1 -0
- package/dist/cjs/formatter/index.js.map +1 -0
- package/dist/{formatter/message-formatter.js → cjs/formatter/message-formatter.cjs} +28 -27
- package/dist/cjs/formatter/message-formatter.d.ts +41 -0
- package/dist/cjs/formatter/message-formatter.d.ts.map +1 -0
- package/dist/cjs/formatter/message-formatter.js.map +1 -0
- package/dist/{formatter/timestamp.js → cjs/formatter/timestamp.cjs} +1 -0
- package/dist/cjs/formatter/timestamp.d.ts.map +1 -0
- package/dist/cjs/formatter/timestamp.js.map +1 -0
- package/dist/cjs/index.cjs +202 -0
- package/dist/cjs/index.d.ts +180 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/logger/advanced-outputs.cjs +587 -0
- package/dist/cjs/logger/advanced-outputs.d.ts +159 -0
- package/dist/cjs/logger/advanced-outputs.d.ts.map +1 -0
- package/dist/cjs/logger/advanced-outputs.js.map +1 -0
- package/dist/{logger/config.js → cjs/logger/config.cjs} +36 -32
- package/dist/cjs/logger/config.d.ts +42 -0
- package/dist/cjs/logger/config.d.ts.map +1 -0
- package/dist/cjs/logger/config.js.map +1 -0
- package/dist/cjs/logger/core.cjs +371 -0
- package/dist/cjs/logger/core.d.ts +152 -0
- package/dist/cjs/logger/core.d.ts.map +1 -0
- package/dist/cjs/logger/core.js.map +1 -0
- package/dist/{logger/environment.js → cjs/logger/environment.cjs} +17 -16
- package/dist/cjs/logger/environment.d.ts +36 -0
- package/dist/cjs/logger/environment.d.ts.map +1 -0
- package/dist/cjs/logger/environment.js.map +1 -0
- package/dist/cjs/logger/filtering.cjs +81 -0
- package/dist/cjs/logger/filtering.d.ts +36 -0
- package/dist/cjs/logger/filtering.d.ts.map +1 -0
- package/dist/cjs/logger/filtering.js.map +1 -0
- package/dist/{logger/index.js → cjs/logger/index.cjs} +6 -5
- package/dist/cjs/logger/index.d.ts.map +1 -0
- package/dist/cjs/logger/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/{redaction/config.js → cjs/redaction/config.cjs} +9 -8
- package/dist/{redaction → cjs/redaction}/config.d.ts +8 -8
- package/dist/cjs/redaction/config.d.ts.map +1 -0
- package/dist/cjs/redaction/config.js.map +1 -0
- package/dist/{redaction/index.js → cjs/redaction/index.cjs} +3 -2
- package/dist/cjs/redaction/index.d.ts.map +1 -0
- package/dist/cjs/redaction/index.js.map +1 -0
- package/dist/cjs/redaction/redactor.cjs +263 -0
- package/dist/cjs/redaction/redactor.d.ts +99 -0
- package/dist/cjs/redaction/redactor.d.ts.map +1 -0
- package/dist/cjs/redaction/redactor.js.map +1 -0
- package/dist/{types/index.js → cjs/types/index.cjs} +1 -0
- package/dist/{types → cjs/types}/index.d.ts +98 -16
- package/dist/cjs/types/index.d.ts.map +1 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/esm/__tests__/async-test-utils.d.ts +51 -0
- package/dist/esm/__tests__/async-test-utils.d.ts.map +1 -0
- package/dist/esm/__tests__/async-test-utils.js +231 -0
- package/dist/esm/__tests__/async-test-utils.js.map +1 -0
- package/dist/esm/__tests__/redaction/test-utils.d.ts +33 -0
- package/dist/esm/__tests__/redaction/test-utils.d.ts.map +1 -0
- package/dist/esm/__tests__/redaction/test-utils.js +65 -0
- package/dist/esm/__tests__/redaction/test-utils.js.map +1 -0
- package/dist/esm/__tests__/test-utils.d.ts +41 -0
- package/dist/esm/__tests__/test-utils.d.ts.map +1 -0
- package/dist/esm/__tests__/test-utils.js +42 -0
- package/dist/esm/__tests__/test-utils.js.map +1 -0
- package/dist/esm/formatter/colors.d.ts +32 -0
- package/dist/esm/formatter/colors.d.ts.map +1 -0
- package/dist/esm/formatter/colors.js +32 -0
- package/dist/esm/formatter/colors.js.map +1 -0
- package/dist/esm/formatter/data-formatter.d.ts +26 -0
- package/dist/esm/formatter/data-formatter.d.ts.map +1 -0
- package/dist/esm/formatter/data-formatter.js +50 -0
- package/dist/esm/formatter/data-formatter.js.map +1 -0
- package/dist/esm/formatter/index.d.ts +10 -0
- package/dist/esm/formatter/index.d.ts.map +1 -0
- package/dist/esm/formatter/index.js +11 -0
- package/dist/esm/formatter/index.js.map +1 -0
- package/dist/esm/formatter/message-formatter.d.ts +41 -0
- package/dist/esm/formatter/message-formatter.d.ts.map +1 -0
- package/dist/esm/formatter/message-formatter.js +84 -0
- package/dist/esm/formatter/message-formatter.js.map +1 -0
- package/dist/esm/formatter/timestamp.d.ts +27 -0
- package/dist/esm/formatter/timestamp.d.ts.map +1 -0
- package/dist/esm/formatter/timestamp.js +36 -0
- package/dist/esm/formatter/timestamp.js.map +1 -0
- package/dist/esm/index.d.ts +180 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +194 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger/advanced-outputs.d.ts +159 -0
- package/dist/esm/logger/advanced-outputs.d.ts.map +1 -0
- package/dist/esm/logger/advanced-outputs.js +542 -0
- package/dist/esm/logger/advanced-outputs.js.map +1 -0
- package/dist/esm/logger/config.d.ts +42 -0
- package/dist/esm/logger/config.d.ts.map +1 -0
- package/dist/esm/logger/config.js +101 -0
- package/dist/esm/logger/config.js.map +1 -0
- package/dist/esm/logger/core.d.ts +152 -0
- package/dist/esm/logger/core.d.ts.map +1 -0
- package/dist/esm/logger/core.js +367 -0
- package/dist/esm/logger/core.js.map +1 -0
- package/dist/esm/logger/environment.d.ts +36 -0
- package/dist/esm/logger/environment.d.ts.map +1 -0
- package/dist/esm/logger/environment.js +58 -0
- package/dist/esm/logger/environment.js.map +1 -0
- package/dist/esm/logger/filtering.d.ts +36 -0
- package/dist/esm/logger/filtering.d.ts.map +1 -0
- package/dist/esm/logger/filtering.js +77 -0
- package/dist/esm/logger/filtering.js.map +1 -0
- package/dist/esm/logger/index.d.ts +10 -0
- package/dist/esm/logger/index.d.ts.map +1 -0
- package/dist/esm/logger/index.js +11 -0
- package/dist/esm/logger/index.js.map +1 -0
- package/dist/esm/redaction/config.d.ts +29 -0
- package/dist/esm/redaction/config.d.ts.map +1 -0
- package/dist/esm/redaction/config.js +92 -0
- package/dist/esm/redaction/config.js.map +1 -0
- package/dist/esm/redaction/index.d.ts +8 -0
- package/dist/esm/redaction/index.d.ts.map +1 -0
- package/dist/esm/redaction/index.js +7 -0
- package/dist/esm/redaction/index.js.map +1 -0
- package/dist/esm/redaction/redactor.d.ts +99 -0
- package/dist/esm/redaction/redactor.d.ts.map +1 -0
- package/dist/esm/redaction/redactor.js +259 -0
- package/dist/esm/redaction/redactor.js.map +1 -0
- package/dist/esm/types/index.d.ts +310 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/index.js +41 -0
- package/dist/esm/types/index.js.map +1 -0
- package/package.json +94 -68
- package/dist/formatter/colors.d.ts.map +0 -1
- package/dist/formatter/data-formatter.d.ts.map +0 -1
- package/dist/formatter/index.d.ts.map +0 -1
- package/dist/formatter/message-formatter.d.ts +0 -41
- package/dist/formatter/message-formatter.d.ts.map +0 -1
- package/dist/formatter/timestamp.d.ts.map +0 -1
- package/dist/index.d.ts +0 -186
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -201
- package/dist/logger/config.d.ts +0 -42
- package/dist/logger/config.d.ts.map +0 -1
- package/dist/logger/core.d.ts +0 -108
- package/dist/logger/core.d.ts.map +0 -1
- package/dist/logger/core.js +0 -185
- package/dist/logger/environment.d.ts +0 -36
- package/dist/logger/environment.d.ts.map +0 -1
- package/dist/logger/filtering.d.ts +0 -36
- package/dist/logger/filtering.d.ts.map +0 -1
- package/dist/logger/filtering.js +0 -65
- package/dist/logger/index.d.ts.map +0 -1
- package/dist/redaction/config.d.ts.map +0 -1
- package/dist/redaction/index.d.ts.map +0 -1
- package/dist/redaction/redactor.d.ts +0 -99
- package/dist/redaction/redactor.d.ts.map +0 -1
- package/dist/redaction/redactor.js +0 -257
- package/dist/types/index.d.ts.map +0 -1
- /package/dist/{formatter → cjs/formatter}/colors.d.ts +0 -0
- /package/dist/{formatter → cjs/formatter}/index.d.ts +0 -0
- /package/dist/{formatter → cjs/formatter}/timestamp.d.ts +0 -0
- /package/dist/{logger → cjs/logger}/index.d.ts +0 -0
- /package/dist/{redaction → cjs/redaction}/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,68 +1,94 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wgtechlabs/log-engine",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A lightweight, security-first logging utility with automatic data redaction for Node.js applications - the first logging library with built-in PII protection.",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@wgtechlabs/log-engine",
|
|
3
|
+
"version": "2.1.1",
|
|
4
|
+
"description": "A lightweight, security-first logging utility with automatic data redaction for Node.js applications - the first logging library with built-in PII protection.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"logging",
|
|
8
|
+
"security",
|
|
9
|
+
"redaction",
|
|
10
|
+
"pii-protection",
|
|
11
|
+
"data-redaction",
|
|
12
|
+
"typescript",
|
|
13
|
+
"nodejs",
|
|
14
|
+
"bot",
|
|
15
|
+
"discord",
|
|
16
|
+
"telegram",
|
|
17
|
+
"privacy",
|
|
18
|
+
"gdpr",
|
|
19
|
+
"compliance"
|
|
20
|
+
],
|
|
21
|
+
"packageManager": "yarn@4.9.2",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "WG Tech Labs <opensource@wgtechlabs.com> (https://wgtechlabs.com)",
|
|
24
|
+
"contributors": [
|
|
25
|
+
"Waren Gonzaga <opensource@warengonzaga.com> (https://warengonzaga.com)"
|
|
26
|
+
],
|
|
27
|
+
"main": "./dist/cjs/index.cjs",
|
|
28
|
+
"module": "./dist/esm/index.js",
|
|
29
|
+
"types": "./dist/esm/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/esm/index.d.ts",
|
|
34
|
+
"default": "./dist/esm/index.js"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./dist/cjs/index.d.ts",
|
|
38
|
+
"default": "./dist/cjs/index.cjs"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist/**/*",
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/wgtechlabs/log-engine.git"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "node scripts/forklift-runner.js --clean",
|
|
53
|
+
"build:watch": "node scripts/forklift-runner.js --watch",
|
|
54
|
+
"start": "node dist/cjs/index.cjs",
|
|
55
|
+
"prepublishOnly": "yarn build",
|
|
56
|
+
"test": "jest",
|
|
57
|
+
"test:watch": "jest --watch",
|
|
58
|
+
"test:coverage": "jest --coverage",
|
|
59
|
+
"test:coverage:watch": "jest --coverage --watch",
|
|
60
|
+
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
61
|
+
"test:unit": "jest --testNamePattern=\"^((?!integration).)*$\"",
|
|
62
|
+
"test:integration": "jest integration.test.ts",
|
|
63
|
+
"test:redaction": "jest --testPathPattern=\"redaction/\"",
|
|
64
|
+
"lint": "eslint src/**/*.ts",
|
|
65
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
66
|
+
"lint:security": "eslint src/**/*.ts --config eslint.security.config.js",
|
|
67
|
+
"secure:scan": "snyk code test",
|
|
68
|
+
"secure:test": "snyk test --org=wgtechlabs",
|
|
69
|
+
"secure:code": "snyk code test --org=wgtechlabs",
|
|
70
|
+
"secure": "run-s lint:security secure:test secure:code",
|
|
71
|
+
"validate": "run-s lint test build",
|
|
72
|
+
"clean": "rm -rf dist coverage",
|
|
73
|
+
"coverage:open": "open coverage/lcov-report/index.html",
|
|
74
|
+
"coverage:upload": "curl -Os https://uploader.codecov.io/latest/windows/codecov.exe && codecov.exe"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@types/eslint-plugin-security": "^3",
|
|
78
|
+
"@types/jest": "^29.0.0",
|
|
79
|
+
"@types/node": "^18.0.0",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
81
|
+
"@typescript-eslint/parser": "^8.35.0",
|
|
82
|
+
"eslint": "^8.45.0",
|
|
83
|
+
"eslint-plugin-security": "^2.0.0",
|
|
84
|
+
"jest": "^29.0.0",
|
|
85
|
+
"npm-run-all": "^4.1.5",
|
|
86
|
+
"snyk": "^1.1000.0",
|
|
87
|
+
"ts-jest": "^29.0.0",
|
|
88
|
+
"ts-node": "^10.0.0",
|
|
89
|
+
"typescript": "^5.8.3"
|
|
90
|
+
},
|
|
91
|
+
"engines": {
|
|
92
|
+
"node": ">=16.0.0"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/formatter/colors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;CAWT,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-formatter.d.ts","sourceRoot":"","sources":["../../src/formatter/data-formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CA2B5C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAM7F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formatter/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,gBAAgB,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core message formatting functionality
|
|
3
|
-
* Handles the main log message formatting with colors, timestamps, and levels
|
|
4
|
-
*/
|
|
5
|
-
import { LogLevel } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* Core message formatter class
|
|
8
|
-
* Provides the main formatting functionality for log messages
|
|
9
|
-
*/
|
|
10
|
-
export declare class MessageFormatter {
|
|
11
|
-
/**
|
|
12
|
-
* Formats a log message with timestamp, level indicator, and appropriate coloring
|
|
13
|
-
* Creates a structured log entry: [ISO_TIMESTAMP][LOCAL_TIME][LEVEL]: message [data]
|
|
14
|
-
* @param level - The log level to format for
|
|
15
|
-
* @param message - The message content to format
|
|
16
|
-
* @param data - Optional data object to include in the log output
|
|
17
|
-
* @returns Formatted string with ANSI colors and timestamps
|
|
18
|
-
*/
|
|
19
|
-
static format(level: LogLevel, message: string, data?: any): string;
|
|
20
|
-
/**
|
|
21
|
-
* Formats a Log Engine system message with [LOG ENGINE] prefix instead of log levels
|
|
22
|
-
* Used for internal messages like deprecation warnings that should be distinguished from user logs
|
|
23
|
-
* @param message - The system message content to format
|
|
24
|
-
* @returns Formatted string with ANSI colors, timestamps, and LOG ENGINE prefix
|
|
25
|
-
*/
|
|
26
|
-
static formatSystemMessage(message: string): string;
|
|
27
|
-
/**
|
|
28
|
-
* Converts LogLevel enum to human-readable string
|
|
29
|
-
* @param level - The LogLevel to convert
|
|
30
|
-
* @returns String representation of the log level
|
|
31
|
-
*/
|
|
32
|
-
private static getLevelName;
|
|
33
|
-
/**
|
|
34
|
-
* Maps LogLevel to appropriate ANSI color code
|
|
35
|
-
* Colors help quickly identify message severity in console output
|
|
36
|
-
* @param level - The LogLevel to get color for
|
|
37
|
-
* @returns ANSI color escape sequence
|
|
38
|
-
*/
|
|
39
|
-
private static getLevelColor;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=message-formatter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-formatter.d.ts","sourceRoot":"","sources":["../../src/formatter/message-formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKpC;;;GAGG;AACH,qBAAa,gBAAgB;IACzB;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,MAAM;IAsBnE;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAUnD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAW3B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;CAU/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../src/formatter/timestamp.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB,CAaA;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC3B,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjE,MAAM,CAKR"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Main LogEngine module - provides a comprehensive logging solution
|
|
3
|
-
* with mode-based filtering, colorized output, and automatic data redaction
|
|
4
|
-
*
|
|
5
|
-
* Features a modular architecture with separate modules for:
|
|
6
|
-
* - Logger: Core logging functionality with environment-based configuration
|
|
7
|
-
* - Formatter: Message formatting with ANSI colors and timestamps
|
|
8
|
-
* - Redaction: Automatic sensitive data protection with customizable patterns
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { LogEngine, LogMode } from '@wgtechlabs/log-engine';
|
|
13
|
-
*
|
|
14
|
-
* // Configure logging mode
|
|
15
|
-
* LogEngine.configure({ mode: LogMode.DEBUG });
|
|
16
|
-
*
|
|
17
|
-
* // Log with automatic redaction
|
|
18
|
-
* LogEngine.info('User login', { username: 'john', password: 'secret123' });
|
|
19
|
-
* // Output: [2025-06-18T...][3:45PM][INFO]: User login { username: 'john', password: '[REDACTED]' }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import type { LoggerConfig, RedactionConfig } from './types';
|
|
23
|
-
/**
|
|
24
|
-
* LogEngine - The main interface for logging operations
|
|
25
|
-
* Provides a simple, intuitive API for all logging needs with security-first design
|
|
26
|
-
*/
|
|
27
|
-
export declare const LogEngine: {
|
|
28
|
-
/**
|
|
29
|
-
* Configure the logger with new settings
|
|
30
|
-
* @param config - Configuration object containing logger settings
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* LogEngine.configure({ mode: LogMode.PRODUCTION });
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
configure: (config: Partial<LoggerConfig>) => void;
|
|
37
|
-
/**
|
|
38
|
-
* Log a debug message with automatic data redaction
|
|
39
|
-
* Only shown in DEVELOPMENT mode
|
|
40
|
-
* @param message - The debug message to log
|
|
41
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* LogEngine.debug('Processing user data', { userId: 123, email: 'user@example.com' });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
debug: (message: string, data?: any) => void;
|
|
48
|
-
/**
|
|
49
|
-
* Log an info message with automatic data redaction
|
|
50
|
-
* Shown in DEVELOPMENT and PRODUCTION modes
|
|
51
|
-
* @param message - The info message to log
|
|
52
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* LogEngine.info('User login successful', { username: 'john' });
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
info: (message: string, data?: any) => void;
|
|
59
|
-
/**
|
|
60
|
-
* Log a warning message with automatic data redaction
|
|
61
|
-
* Shown in DEVELOPMENT and PRODUCTION modes
|
|
62
|
-
* @param message - The warning message to log
|
|
63
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
64
|
-
* @example
|
|
65
|
-
* ```typescript
|
|
66
|
-
* LogEngine.warn('API rate limit approaching', { requestsRemaining: 10 });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
warn: (message: string, data?: any) => void;
|
|
70
|
-
/**
|
|
71
|
-
* Log an error message with automatic data redaction
|
|
72
|
-
* Shown in DEVELOPMENT and PRODUCTION modes
|
|
73
|
-
* @param message - The error message to log
|
|
74
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* LogEngine.error('Database connection failed', { host: 'localhost', port: 5432 });
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
error: (message: string, data?: any) => void;
|
|
81
|
-
/**
|
|
82
|
-
* Log a critical message with automatic data redaction
|
|
83
|
-
* Always shown regardless of mode (except OFF)
|
|
84
|
-
* @param message - The critical log message to log
|
|
85
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
86
|
-
* @example
|
|
87
|
-
* ```typescript
|
|
88
|
-
* LogEngine.log('Application starting', { version: '1.0.0' });
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
log: (message: string, data?: any) => void;
|
|
92
|
-
/**
|
|
93
|
-
* Log a debug message without redaction (use with caution)
|
|
94
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
95
|
-
* @param message - The debug message to log
|
|
96
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
97
|
-
*/
|
|
98
|
-
debugRaw: (message: string, data?: any) => void;
|
|
99
|
-
/**
|
|
100
|
-
* Log an info message without redaction (use with caution)
|
|
101
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
102
|
-
* @param message - The info message to log
|
|
103
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
104
|
-
*/
|
|
105
|
-
infoRaw: (message: string, data?: any) => void;
|
|
106
|
-
/**
|
|
107
|
-
* Log a warning message without redaction (use with caution)
|
|
108
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
109
|
-
* @param message - The warning message to log
|
|
110
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
111
|
-
*/
|
|
112
|
-
warnRaw: (message: string, data?: any) => void;
|
|
113
|
-
/**
|
|
114
|
-
* Log an error message without redaction (use with caution)
|
|
115
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
116
|
-
* @param message - The error message to log
|
|
117
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
118
|
-
*/
|
|
119
|
-
errorRaw: (message: string, data?: any) => void;
|
|
120
|
-
/**
|
|
121
|
-
* Log a critical message without redaction (use with caution)
|
|
122
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
123
|
-
* @param message - The critical log message to log
|
|
124
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
125
|
-
*/
|
|
126
|
-
logRaw: (message: string, data?: any) => void;
|
|
127
|
-
/**
|
|
128
|
-
* Configure data redaction settings
|
|
129
|
-
* @param config - Partial redaction configuration to apply
|
|
130
|
-
*/
|
|
131
|
-
configureRedaction: (config: Partial<RedactionConfig>) => void;
|
|
132
|
-
/**
|
|
133
|
-
* Refresh redaction configuration from environment variables
|
|
134
|
-
* Useful for picking up runtime environment changes
|
|
135
|
-
*/
|
|
136
|
-
refreshRedactionConfig: () => void;
|
|
137
|
-
/**
|
|
138
|
-
* Reset redaction configuration to defaults
|
|
139
|
-
*/
|
|
140
|
-
resetRedactionConfig: () => void;
|
|
141
|
-
/**
|
|
142
|
-
* Get current redaction configuration
|
|
143
|
-
* @returns Current redaction configuration
|
|
144
|
-
*/
|
|
145
|
-
getRedactionConfig: () => RedactionConfig;
|
|
146
|
-
/**
|
|
147
|
-
* Add custom regex patterns for advanced field detection
|
|
148
|
-
* @param patterns - Array of regex patterns to add
|
|
149
|
-
*/
|
|
150
|
-
addCustomRedactionPatterns: (patterns: RegExp[]) => void;
|
|
151
|
-
/**
|
|
152
|
-
* Clear all custom redaction patterns
|
|
153
|
-
*/
|
|
154
|
-
clearCustomRedactionPatterns: () => void;
|
|
155
|
-
/**
|
|
156
|
-
* Add custom sensitive field names to the existing list
|
|
157
|
-
* @param fields - Array of field names to add
|
|
158
|
-
*/
|
|
159
|
-
addSensitiveFields: (fields: string[]) => void;
|
|
160
|
-
/**
|
|
161
|
-
* Test if a field name would be redacted with current configuration
|
|
162
|
-
* @param fieldName - Field name to test
|
|
163
|
-
* @returns true if field would be redacted, false otherwise
|
|
164
|
-
*/
|
|
165
|
-
testFieldRedaction: (fieldName: string) => boolean;
|
|
166
|
-
/**
|
|
167
|
-
* Temporarily disable redaction for a specific logging call
|
|
168
|
-
* @returns LogEngine instance with redaction bypassed
|
|
169
|
-
* @example
|
|
170
|
-
* ```typescript
|
|
171
|
-
* LogEngine.withoutRedaction().info('Debug data', sensitiveObject);
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
174
|
-
withoutRedaction: () => {
|
|
175
|
-
debug: (message: string, data?: any) => void;
|
|
176
|
-
info: (message: string, data?: any) => void;
|
|
177
|
-
warn: (message: string, data?: any) => void;
|
|
178
|
-
error: (message: string, data?: any) => void;
|
|
179
|
-
log: (message: string, data?: any) => void;
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
export { LogMode, LogLevel } from './types';
|
|
183
|
-
export type { LoggerConfig, RedactionConfig } from './types';
|
|
184
|
-
export { DataRedactor, defaultRedactionConfig, RedactionController } from './redaction';
|
|
185
|
-
export default LogEngine;
|
|
186
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM7D;;;GAGG;AACH,eAAO,MAAM,SAAS;IAClB;;;;;;;OAOG;wBACiB,OAAO,CAAC,YAAY,CAAC;IAGzC;;;;;;;;;OASG;qBACc,MAAM,SAAS,GAAG;IAEnC;;;;;;;;;OASG;oBACa,MAAM,SAAS,GAAG;IAElC;;;;;;;;;OASG;oBACa,MAAM,SAAS,GAAG;IAElC;;;;;;;;;OASG;qBACc,MAAM,SAAS,GAAG;IAEnC;;;;;;;;;OASG;mBACY,MAAM,SAAS,GAAG;IAGjC;;;;;OAKG;wBACiB,MAAM,SAAS,GAAG;IAEtC;;;;;OAKG;uBACgB,MAAM,SAAS,GAAG;IAErC;;;;;OAKG;uBACgB,MAAM,SAAS,GAAG;IAErC;;;;;OAKG;wBACiB,MAAM,SAAS,GAAG;IAEtC;;;;;OAKG;sBACe,MAAM,SAAS,GAAG;IAGpC;;;OAGG;iCAC0B,OAAO,CAAC,eAAe,CAAC;IAErD;;;OAGG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAIH;;;OAGG;2CACoC,MAAM,EAAE;IAE/C;;OAEG;;IAGH;;;OAGG;iCAC0B,MAAM,EAAE;IAErC;;;;OAIG;oCAC6B,MAAM;IAEtC;;;;;;;OAOG;;yBAEkB,MAAM,SAAS,GAAG;wBACnB,MAAM,SAAS,GAAG;wBAClB,MAAM,SAAS,GAAG;yBACjB,MAAM,SAAS,GAAG;uBACpB,MAAM,SAAS,GAAG;;CAExC,CAAC;AAGF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGxF,eAAe,SAAS,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Main LogEngine module - provides a comprehensive logging solution
|
|
4
|
-
* with mode-based filtering, colorized output, and automatic data redaction
|
|
5
|
-
*
|
|
6
|
-
* Features a modular architecture with separate modules for:
|
|
7
|
-
* - Logger: Core logging functionality with environment-based configuration
|
|
8
|
-
* - Formatter: Message formatting with ANSI colors and timestamps
|
|
9
|
-
* - Redaction: Automatic sensitive data protection with customizable patterns
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* import { LogEngine, LogMode } from '@wgtechlabs/log-engine';
|
|
14
|
-
*
|
|
15
|
-
* // Configure logging mode
|
|
16
|
-
* LogEngine.configure({ mode: LogMode.DEBUG });
|
|
17
|
-
*
|
|
18
|
-
* // Log with automatic redaction
|
|
19
|
-
* LogEngine.info('User login', { username: 'john', password: 'secret123' });
|
|
20
|
-
* // Output: [2025-06-18T...][3:45PM][INFO]: User login { username: 'john', password: '[REDACTED]' }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.RedactionController = exports.defaultRedactionConfig = exports.DataRedactor = exports.LogLevel = exports.LogMode = exports.LogEngine = void 0;
|
|
25
|
-
const logger_1 = require("./logger");
|
|
26
|
-
const redaction_1 = require("./redaction");
|
|
27
|
-
// Create a singleton logger instance
|
|
28
|
-
const logger = new logger_1.Logger();
|
|
29
|
-
/**
|
|
30
|
-
* LogEngine - The main interface for logging operations
|
|
31
|
-
* Provides a simple, intuitive API for all logging needs with security-first design
|
|
32
|
-
*/
|
|
33
|
-
exports.LogEngine = {
|
|
34
|
-
/**
|
|
35
|
-
* Configure the logger with new settings
|
|
36
|
-
* @param config - Configuration object containing logger settings
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* LogEngine.configure({ mode: LogMode.PRODUCTION });
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
configure: (config) => logger.configure(config),
|
|
43
|
-
// Standard logging methods with automatic redaction
|
|
44
|
-
/**
|
|
45
|
-
* Log a debug message with automatic data redaction
|
|
46
|
-
* Only shown in DEVELOPMENT mode
|
|
47
|
-
* @param message - The debug message to log
|
|
48
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* LogEngine.debug('Processing user data', { userId: 123, email: 'user@example.com' });
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
debug: (message, data) => logger.debug(message, data),
|
|
55
|
-
/**
|
|
56
|
-
* Log an info message with automatic data redaction
|
|
57
|
-
* Shown in DEVELOPMENT and PRODUCTION modes
|
|
58
|
-
* @param message - The info message to log
|
|
59
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* LogEngine.info('User login successful', { username: 'john' });
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
info: (message, data) => logger.info(message, data),
|
|
66
|
-
/**
|
|
67
|
-
* Log a warning message with automatic data redaction
|
|
68
|
-
* Shown in DEVELOPMENT and PRODUCTION modes
|
|
69
|
-
* @param message - The warning message to log
|
|
70
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
71
|
-
* @example
|
|
72
|
-
* ```typescript
|
|
73
|
-
* LogEngine.warn('API rate limit approaching', { requestsRemaining: 10 });
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
warn: (message, data) => logger.warn(message, data),
|
|
77
|
-
/**
|
|
78
|
-
* Log an error message with automatic data redaction
|
|
79
|
-
* Shown in DEVELOPMENT and PRODUCTION modes
|
|
80
|
-
* @param message - The error message to log
|
|
81
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
82
|
-
* @example
|
|
83
|
-
* ```typescript
|
|
84
|
-
* LogEngine.error('Database connection failed', { host: 'localhost', port: 5432 });
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
error: (message, data) => logger.error(message, data),
|
|
88
|
-
/**
|
|
89
|
-
* Log a critical message with automatic data redaction
|
|
90
|
-
* Always shown regardless of mode (except OFF)
|
|
91
|
-
* @param message - The critical log message to log
|
|
92
|
-
* @param data - Optional data object to log (sensitive data will be redacted)
|
|
93
|
-
* @example
|
|
94
|
-
* ```typescript
|
|
95
|
-
* LogEngine.log('Application starting', { version: '1.0.0' });
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
log: (message, data) => logger.log(message, data),
|
|
99
|
-
// Raw methods that bypass redaction (use with caution)
|
|
100
|
-
/**
|
|
101
|
-
* Log a debug message without redaction (use with caution)
|
|
102
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
103
|
-
* @param message - The debug message to log
|
|
104
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
105
|
-
*/
|
|
106
|
-
debugRaw: (message, data) => logger.debugRaw(message, data),
|
|
107
|
-
/**
|
|
108
|
-
* Log an info message without redaction (use with caution)
|
|
109
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
110
|
-
* @param message - The info message to log
|
|
111
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
112
|
-
*/
|
|
113
|
-
infoRaw: (message, data) => logger.infoRaw(message, data),
|
|
114
|
-
/**
|
|
115
|
-
* Log a warning message without redaction (use with caution)
|
|
116
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
117
|
-
* @param message - The warning message to log
|
|
118
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
119
|
-
*/
|
|
120
|
-
warnRaw: (message, data) => logger.warnRaw(message, data),
|
|
121
|
-
/**
|
|
122
|
-
* Log an error message without redaction (use with caution)
|
|
123
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
124
|
-
* @param message - The error message to log
|
|
125
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
126
|
-
*/
|
|
127
|
-
errorRaw: (message, data) => logger.errorRaw(message, data),
|
|
128
|
-
/**
|
|
129
|
-
* Log a critical message without redaction (use with caution)
|
|
130
|
-
* Bypasses automatic data redaction for debugging purposes
|
|
131
|
-
* @param message - The critical log message to log
|
|
132
|
-
* @param data - Optional data object to log (no redaction applied)
|
|
133
|
-
*/
|
|
134
|
-
logRaw: (message, data) => logger.logRaw(message, data),
|
|
135
|
-
// Redaction configuration methods
|
|
136
|
-
/**
|
|
137
|
-
* Configure data redaction settings
|
|
138
|
-
* @param config - Partial redaction configuration to apply
|
|
139
|
-
*/
|
|
140
|
-
configureRedaction: (config) => redaction_1.DataRedactor.updateConfig(config),
|
|
141
|
-
/**
|
|
142
|
-
* Refresh redaction configuration from environment variables
|
|
143
|
-
* Useful for picking up runtime environment changes
|
|
144
|
-
*/
|
|
145
|
-
refreshRedactionConfig: () => redaction_1.DataRedactor.refreshConfig(),
|
|
146
|
-
/**
|
|
147
|
-
* Reset redaction configuration to defaults
|
|
148
|
-
*/
|
|
149
|
-
resetRedactionConfig: () => redaction_1.DataRedactor.updateConfig(redaction_1.defaultRedactionConfig),
|
|
150
|
-
/**
|
|
151
|
-
* Get current redaction configuration
|
|
152
|
-
* @returns Current redaction configuration
|
|
153
|
-
*/
|
|
154
|
-
getRedactionConfig: () => redaction_1.DataRedactor.getConfig(),
|
|
155
|
-
// Advanced redaction methods (Phase 3)
|
|
156
|
-
/**
|
|
157
|
-
* Add custom regex patterns for advanced field detection
|
|
158
|
-
* @param patterns - Array of regex patterns to add
|
|
159
|
-
*/
|
|
160
|
-
addCustomRedactionPatterns: (patterns) => redaction_1.DataRedactor.addCustomPatterns(patterns),
|
|
161
|
-
/**
|
|
162
|
-
* Clear all custom redaction patterns
|
|
163
|
-
*/
|
|
164
|
-
clearCustomRedactionPatterns: () => redaction_1.DataRedactor.clearCustomPatterns(),
|
|
165
|
-
/**
|
|
166
|
-
* Add custom sensitive field names to the existing list
|
|
167
|
-
* @param fields - Array of field names to add
|
|
168
|
-
*/
|
|
169
|
-
addSensitiveFields: (fields) => redaction_1.DataRedactor.addSensitiveFields(fields),
|
|
170
|
-
/**
|
|
171
|
-
* Test if a field name would be redacted with current configuration
|
|
172
|
-
* @param fieldName - Field name to test
|
|
173
|
-
* @returns true if field would be redacted, false otherwise
|
|
174
|
-
*/
|
|
175
|
-
testFieldRedaction: (fieldName) => redaction_1.DataRedactor.testFieldRedaction(fieldName),
|
|
176
|
-
/**
|
|
177
|
-
* Temporarily disable redaction for a specific logging call
|
|
178
|
-
* @returns LogEngine instance with redaction bypassed
|
|
179
|
-
* @example
|
|
180
|
-
* ```typescript
|
|
181
|
-
* LogEngine.withoutRedaction().info('Debug data', sensitiveObject);
|
|
182
|
-
* ```
|
|
183
|
-
*/
|
|
184
|
-
withoutRedaction: () => ({
|
|
185
|
-
debug: (message, data) => logger.debugRaw(message, data),
|
|
186
|
-
info: (message, data) => logger.infoRaw(message, data),
|
|
187
|
-
warn: (message, data) => logger.warnRaw(message, data),
|
|
188
|
-
error: (message, data) => logger.errorRaw(message, data),
|
|
189
|
-
log: (message, data) => logger.logRaw(message, data)
|
|
190
|
-
})
|
|
191
|
-
};
|
|
192
|
-
// Re-export types and utilities for external use
|
|
193
|
-
var types_1 = require("./types");
|
|
194
|
-
Object.defineProperty(exports, "LogMode", { enumerable: true, get: function () { return types_1.LogMode; } });
|
|
195
|
-
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return types_1.LogLevel; } });
|
|
196
|
-
var redaction_2 = require("./redaction");
|
|
197
|
-
Object.defineProperty(exports, "DataRedactor", { enumerable: true, get: function () { return redaction_2.DataRedactor; } });
|
|
198
|
-
Object.defineProperty(exports, "defaultRedactionConfig", { enumerable: true, get: function () { return redaction_2.defaultRedactionConfig; } });
|
|
199
|
-
Object.defineProperty(exports, "RedactionController", { enumerable: true, get: function () { return redaction_2.RedactionController; } });
|
|
200
|
-
// Default export for convenience
|
|
201
|
-
exports.default = exports.LogEngine;
|
package/dist/logger/config.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger configuration management
|
|
3
|
-
* Handles logger settings and configuration updates
|
|
4
|
-
*/
|
|
5
|
-
import { LoggerConfig } from '../types';
|
|
6
|
-
/**
|
|
7
|
-
* Configuration manager for logger settings
|
|
8
|
-
* Handles configuration validation, updates, and backward compatibility
|
|
9
|
-
*/
|
|
10
|
-
export declare class LoggerConfigManager {
|
|
11
|
-
private config;
|
|
12
|
-
constructor();
|
|
13
|
-
/**
|
|
14
|
-
* Get current configuration
|
|
15
|
-
* @returns Current logger configuration
|
|
16
|
-
*/
|
|
17
|
-
getConfig(): LoggerConfig;
|
|
18
|
-
/**
|
|
19
|
-
* Updates logger configuration with new settings
|
|
20
|
-
* Merges provided config with existing settings (partial update)
|
|
21
|
-
* Supports backwards compatibility by mapping level to mode with deprecation warnings
|
|
22
|
-
* @param config - Partial configuration object to apply
|
|
23
|
-
*/
|
|
24
|
-
updateConfig(config: Partial<LoggerConfig>): void;
|
|
25
|
-
/**
|
|
26
|
-
* Handle legacy level-based configuration with deprecation warnings
|
|
27
|
-
* @param config - Configuration containing legacy level property
|
|
28
|
-
*/
|
|
29
|
-
private handleLegacyLevelConfig;
|
|
30
|
-
/**
|
|
31
|
-
* Map legacy LogLevel values to LogMode values
|
|
32
|
-
* @param levelValue - Legacy level value
|
|
33
|
-
* @returns Corresponding LogMode or undefined if invalid
|
|
34
|
-
*/
|
|
35
|
-
private mapLevelToMode;
|
|
36
|
-
/**
|
|
37
|
-
* Create deprecation warning message using LogFormatter
|
|
38
|
-
* Outputs formatted deprecation warning messages to console
|
|
39
|
-
*/
|
|
40
|
-
private createDeprecationWarning;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/logger/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAqB,MAAM,UAAU,CAAC;AAG3D;;;GAGG;AACH,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,MAAM,CAAe;;IAS7B;;;OAGG;IACH,SAAS,IAAI,YAAY;IAIzB;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAgBjD;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAqB/B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IActB;;;OAGG;IACH,OAAO,CAAC,wBAAwB;CAQnC"}
|