@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.
Files changed (182) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +869 -608
  3. package/dist/cjs/__tests__/async-test-utils.cjs +276 -0
  4. package/dist/cjs/__tests__/async-test-utils.d.ts +51 -0
  5. package/dist/cjs/__tests__/async-test-utils.d.ts.map +1 -0
  6. package/dist/cjs/__tests__/async-test-utils.js.map +1 -0
  7. package/dist/cjs/__tests__/redaction/test-utils.cjs +72 -0
  8. package/dist/cjs/__tests__/redaction/test-utils.d.ts +33 -0
  9. package/dist/cjs/__tests__/redaction/test-utils.d.ts.map +1 -0
  10. package/dist/cjs/__tests__/redaction/test-utils.js.map +1 -0
  11. package/dist/cjs/__tests__/test-utils.cjs +49 -0
  12. package/dist/cjs/__tests__/test-utils.d.ts +41 -0
  13. package/dist/cjs/__tests__/test-utils.d.ts.map +1 -0
  14. package/dist/cjs/__tests__/test-utils.js.map +1 -0
  15. package/dist/{formatter/colors.js → cjs/formatter/colors.cjs} +1 -0
  16. package/dist/cjs/formatter/colors.d.ts.map +1 -0
  17. package/dist/cjs/formatter/colors.js.map +1 -0
  18. package/dist/{formatter/data-formatter.js → cjs/formatter/data-formatter.cjs} +2 -1
  19. package/dist/{formatter → cjs/formatter}/data-formatter.d.ts +2 -1
  20. package/dist/cjs/formatter/data-formatter.d.ts.map +1 -0
  21. package/dist/cjs/formatter/data-formatter.js.map +1 -0
  22. package/dist/{formatter/index.js → cjs/formatter/index.cjs} +6 -5
  23. package/dist/cjs/formatter/index.d.ts.map +1 -0
  24. package/dist/cjs/formatter/index.js.map +1 -0
  25. package/dist/{formatter/message-formatter.js → cjs/formatter/message-formatter.cjs} +28 -27
  26. package/dist/cjs/formatter/message-formatter.d.ts +41 -0
  27. package/dist/cjs/formatter/message-formatter.d.ts.map +1 -0
  28. package/dist/cjs/formatter/message-formatter.js.map +1 -0
  29. package/dist/{formatter/timestamp.js → cjs/formatter/timestamp.cjs} +1 -0
  30. package/dist/cjs/formatter/timestamp.d.ts.map +1 -0
  31. package/dist/cjs/formatter/timestamp.js.map +1 -0
  32. package/dist/cjs/index.cjs +202 -0
  33. package/dist/cjs/index.d.ts +180 -0
  34. package/dist/cjs/index.d.ts.map +1 -0
  35. package/dist/cjs/index.js.map +1 -0
  36. package/dist/cjs/logger/advanced-outputs.cjs +587 -0
  37. package/dist/cjs/logger/advanced-outputs.d.ts +159 -0
  38. package/dist/cjs/logger/advanced-outputs.d.ts.map +1 -0
  39. package/dist/cjs/logger/advanced-outputs.js.map +1 -0
  40. package/dist/{logger/config.js → cjs/logger/config.cjs} +36 -32
  41. package/dist/cjs/logger/config.d.ts +42 -0
  42. package/dist/cjs/logger/config.d.ts.map +1 -0
  43. package/dist/cjs/logger/config.js.map +1 -0
  44. package/dist/cjs/logger/core.cjs +371 -0
  45. package/dist/cjs/logger/core.d.ts +152 -0
  46. package/dist/cjs/logger/core.d.ts.map +1 -0
  47. package/dist/cjs/logger/core.js.map +1 -0
  48. package/dist/{logger/environment.js → cjs/logger/environment.cjs} +17 -16
  49. package/dist/cjs/logger/environment.d.ts +36 -0
  50. package/dist/cjs/logger/environment.d.ts.map +1 -0
  51. package/dist/cjs/logger/environment.js.map +1 -0
  52. package/dist/cjs/logger/filtering.cjs +81 -0
  53. package/dist/cjs/logger/filtering.d.ts +36 -0
  54. package/dist/cjs/logger/filtering.d.ts.map +1 -0
  55. package/dist/cjs/logger/filtering.js.map +1 -0
  56. package/dist/{logger/index.js → cjs/logger/index.cjs} +6 -5
  57. package/dist/cjs/logger/index.d.ts.map +1 -0
  58. package/dist/cjs/logger/index.js.map +1 -0
  59. package/dist/cjs/package.json +3 -0
  60. package/dist/{redaction/config.js → cjs/redaction/config.cjs} +9 -8
  61. package/dist/{redaction → cjs/redaction}/config.d.ts +8 -8
  62. package/dist/cjs/redaction/config.d.ts.map +1 -0
  63. package/dist/cjs/redaction/config.js.map +1 -0
  64. package/dist/{redaction/index.js → cjs/redaction/index.cjs} +3 -2
  65. package/dist/cjs/redaction/index.d.ts.map +1 -0
  66. package/dist/cjs/redaction/index.js.map +1 -0
  67. package/dist/cjs/redaction/redactor.cjs +263 -0
  68. package/dist/cjs/redaction/redactor.d.ts +99 -0
  69. package/dist/cjs/redaction/redactor.d.ts.map +1 -0
  70. package/dist/cjs/redaction/redactor.js.map +1 -0
  71. package/dist/{types/index.js → cjs/types/index.cjs} +1 -0
  72. package/dist/{types → cjs/types}/index.d.ts +98 -16
  73. package/dist/cjs/types/index.d.ts.map +1 -0
  74. package/dist/cjs/types/index.js.map +1 -0
  75. package/dist/esm/__tests__/async-test-utils.d.ts +51 -0
  76. package/dist/esm/__tests__/async-test-utils.d.ts.map +1 -0
  77. package/dist/esm/__tests__/async-test-utils.js +231 -0
  78. package/dist/esm/__tests__/async-test-utils.js.map +1 -0
  79. package/dist/esm/__tests__/redaction/test-utils.d.ts +33 -0
  80. package/dist/esm/__tests__/redaction/test-utils.d.ts.map +1 -0
  81. package/dist/esm/__tests__/redaction/test-utils.js +65 -0
  82. package/dist/esm/__tests__/redaction/test-utils.js.map +1 -0
  83. package/dist/esm/__tests__/test-utils.d.ts +41 -0
  84. package/dist/esm/__tests__/test-utils.d.ts.map +1 -0
  85. package/dist/esm/__tests__/test-utils.js +42 -0
  86. package/dist/esm/__tests__/test-utils.js.map +1 -0
  87. package/dist/esm/formatter/colors.d.ts +32 -0
  88. package/dist/esm/formatter/colors.d.ts.map +1 -0
  89. package/dist/esm/formatter/colors.js +32 -0
  90. package/dist/esm/formatter/colors.js.map +1 -0
  91. package/dist/esm/formatter/data-formatter.d.ts +26 -0
  92. package/dist/esm/formatter/data-formatter.d.ts.map +1 -0
  93. package/dist/esm/formatter/data-formatter.js +50 -0
  94. package/dist/esm/formatter/data-formatter.js.map +1 -0
  95. package/dist/esm/formatter/index.d.ts +10 -0
  96. package/dist/esm/formatter/index.d.ts.map +1 -0
  97. package/dist/esm/formatter/index.js +11 -0
  98. package/dist/esm/formatter/index.js.map +1 -0
  99. package/dist/esm/formatter/message-formatter.d.ts +41 -0
  100. package/dist/esm/formatter/message-formatter.d.ts.map +1 -0
  101. package/dist/esm/formatter/message-formatter.js +84 -0
  102. package/dist/esm/formatter/message-formatter.js.map +1 -0
  103. package/dist/esm/formatter/timestamp.d.ts +27 -0
  104. package/dist/esm/formatter/timestamp.d.ts.map +1 -0
  105. package/dist/esm/formatter/timestamp.js +36 -0
  106. package/dist/esm/formatter/timestamp.js.map +1 -0
  107. package/dist/esm/index.d.ts +180 -0
  108. package/dist/esm/index.d.ts.map +1 -0
  109. package/dist/esm/index.js +194 -0
  110. package/dist/esm/index.js.map +1 -0
  111. package/dist/esm/logger/advanced-outputs.d.ts +159 -0
  112. package/dist/esm/logger/advanced-outputs.d.ts.map +1 -0
  113. package/dist/esm/logger/advanced-outputs.js +542 -0
  114. package/dist/esm/logger/advanced-outputs.js.map +1 -0
  115. package/dist/esm/logger/config.d.ts +42 -0
  116. package/dist/esm/logger/config.d.ts.map +1 -0
  117. package/dist/esm/logger/config.js +101 -0
  118. package/dist/esm/logger/config.js.map +1 -0
  119. package/dist/esm/logger/core.d.ts +152 -0
  120. package/dist/esm/logger/core.d.ts.map +1 -0
  121. package/dist/esm/logger/core.js +367 -0
  122. package/dist/esm/logger/core.js.map +1 -0
  123. package/dist/esm/logger/environment.d.ts +36 -0
  124. package/dist/esm/logger/environment.d.ts.map +1 -0
  125. package/dist/esm/logger/environment.js +58 -0
  126. package/dist/esm/logger/environment.js.map +1 -0
  127. package/dist/esm/logger/filtering.d.ts +36 -0
  128. package/dist/esm/logger/filtering.d.ts.map +1 -0
  129. package/dist/esm/logger/filtering.js +77 -0
  130. package/dist/esm/logger/filtering.js.map +1 -0
  131. package/dist/esm/logger/index.d.ts +10 -0
  132. package/dist/esm/logger/index.d.ts.map +1 -0
  133. package/dist/esm/logger/index.js +11 -0
  134. package/dist/esm/logger/index.js.map +1 -0
  135. package/dist/esm/redaction/config.d.ts +29 -0
  136. package/dist/esm/redaction/config.d.ts.map +1 -0
  137. package/dist/esm/redaction/config.js +92 -0
  138. package/dist/esm/redaction/config.js.map +1 -0
  139. package/dist/esm/redaction/index.d.ts +8 -0
  140. package/dist/esm/redaction/index.d.ts.map +1 -0
  141. package/dist/esm/redaction/index.js +7 -0
  142. package/dist/esm/redaction/index.js.map +1 -0
  143. package/dist/esm/redaction/redactor.d.ts +99 -0
  144. package/dist/esm/redaction/redactor.d.ts.map +1 -0
  145. package/dist/esm/redaction/redactor.js +259 -0
  146. package/dist/esm/redaction/redactor.js.map +1 -0
  147. package/dist/esm/types/index.d.ts +310 -0
  148. package/dist/esm/types/index.d.ts.map +1 -0
  149. package/dist/esm/types/index.js +41 -0
  150. package/dist/esm/types/index.js.map +1 -0
  151. package/package.json +94 -68
  152. package/dist/formatter/colors.d.ts.map +0 -1
  153. package/dist/formatter/data-formatter.d.ts.map +0 -1
  154. package/dist/formatter/index.d.ts.map +0 -1
  155. package/dist/formatter/message-formatter.d.ts +0 -41
  156. package/dist/formatter/message-formatter.d.ts.map +0 -1
  157. package/dist/formatter/timestamp.d.ts.map +0 -1
  158. package/dist/index.d.ts +0 -186
  159. package/dist/index.d.ts.map +0 -1
  160. package/dist/index.js +0 -201
  161. package/dist/logger/config.d.ts +0 -42
  162. package/dist/logger/config.d.ts.map +0 -1
  163. package/dist/logger/core.d.ts +0 -108
  164. package/dist/logger/core.d.ts.map +0 -1
  165. package/dist/logger/core.js +0 -185
  166. package/dist/logger/environment.d.ts +0 -36
  167. package/dist/logger/environment.d.ts.map +0 -1
  168. package/dist/logger/filtering.d.ts +0 -36
  169. package/dist/logger/filtering.d.ts.map +0 -1
  170. package/dist/logger/filtering.js +0 -65
  171. package/dist/logger/index.d.ts.map +0 -1
  172. package/dist/redaction/config.d.ts.map +0 -1
  173. package/dist/redaction/index.d.ts.map +0 -1
  174. package/dist/redaction/redactor.d.ts +0 -99
  175. package/dist/redaction/redactor.d.ts.map +0 -1
  176. package/dist/redaction/redactor.js +0 -257
  177. package/dist/types/index.d.ts.map +0 -1
  178. /package/dist/{formatter → cjs/formatter}/colors.d.ts +0 -0
  179. /package/dist/{formatter → cjs/formatter}/index.d.ts +0 -0
  180. /package/dist/{formatter → cjs/formatter}/timestamp.d.ts +0 -0
  181. /package/dist/{logger → cjs/logger}/index.d.ts +0 -0
  182. /package/dist/{redaction → cjs/redaction}/index.d.ts +0 -0
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Logger configuration management
3
+ * Handles logger settings and configuration updates
4
+ */
5
+ import { LogLevel, LogMode } from '../types/index.js';
6
+ import { EnvironmentDetector } from './environment.js';
7
+ /**
8
+ * Configuration manager for logger settings
9
+ * Handles configuration validation, updates, and backward compatibility
10
+ */
11
+ export class LoggerConfigManager {
12
+ constructor() {
13
+ // Set initial configuration with environment-based auto-configuration
14
+ this.config = {
15
+ mode: EnvironmentDetector.getEnvironmentMode()
16
+ };
17
+ }
18
+ /**
19
+ * Get current configuration
20
+ * @returns Current logger configuration
21
+ */
22
+ getConfig() {
23
+ return { ...this.config };
24
+ }
25
+ /**
26
+ * Updates logger configuration with new settings
27
+ * Merges provided config with existing settings (partial update)
28
+ * Supports backwards compatibility by mapping level to mode with deprecation warnings
29
+ * @param config - Partial configuration object to apply
30
+ */
31
+ updateConfig(config) {
32
+ // Handle backwards compatibility - if level is provided but mode is not
33
+ if (config.level !== undefined && config.mode === undefined) {
34
+ this.handleLegacyLevelConfig(config);
35
+ }
36
+ else {
37
+ // Normal configuration update
38
+ // If mode is present, remove legacy level property to avoid conflicts
39
+ if (config.mode !== undefined && config.level !== undefined) {
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
41
+ const { level, ...configWithoutLevel } = config;
42
+ this.config = { ...this.config, ...configWithoutLevel };
43
+ }
44
+ else {
45
+ this.config = { ...this.config, ...config };
46
+ }
47
+ }
48
+ }
49
+ /**
50
+ * Handle legacy level-based configuration with deprecation warnings
51
+ * @param config - Configuration containing legacy level property
52
+ */
53
+ handleLegacyLevelConfig(config) {
54
+ // Map legacy level values to new LogMode values and validate first
55
+ const levelValue = config.level;
56
+ const mappedMode = this.mapLevelToMode(levelValue);
57
+ // Fail fast if the level value is invalid
58
+ if (mappedMode === undefined) {
59
+ throw new Error(`Invalid LogLevel value: ${config.level}. Valid values are: DEBUG(0), INFO(1), WARN(2), ERROR(3), LOG(99), or use LogMode instead.`);
60
+ }
61
+ // Only show deprecation warning after confirming the level is valid and in non-test environments
62
+ if (!EnvironmentDetector.isTestEnvironment()) {
63
+ this.createDeprecationWarning();
64
+ }
65
+ // Merge existing config with all keys from the passed config, and override mode with mapped value
66
+ // Remove the legacy 'level' property to avoid conflicts with the new 'mode' property
67
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
68
+ const { level, ...configWithoutLevel } = config;
69
+ this.config = { ...this.config, ...configWithoutLevel, mode: mappedMode };
70
+ }
71
+ /**
72
+ * Map legacy LogLevel values to LogMode values
73
+ * @param levelValue - Legacy level value
74
+ * @returns Corresponding LogMode or undefined if invalid
75
+ */
76
+ mapLevelToMode(levelValue) {
77
+ // Use switch statement to avoid object injection
78
+ switch (levelValue) {
79
+ case LogLevel.DEBUG: return LogMode.DEBUG; // 0 -> 0
80
+ case LogLevel.INFO: return LogMode.INFO; // 1 -> 1
81
+ case LogLevel.WARN: return LogMode.WARN; // 2 -> 2
82
+ case LogLevel.ERROR: return LogMode.ERROR; // 3 -> 3
83
+ case LogLevel.LOG: return LogMode.SILENT; // 99 -> 4 (preserves critical-only behavior)
84
+ case 4: return LogMode.SILENT; // Legacy SILENT -> 4
85
+ case 5: return LogMode.OFF; // Legacy OFF -> 5
86
+ default: return undefined;
87
+ }
88
+ }
89
+ /**
90
+ * Create deprecation warning message using LogFormatter
91
+ * Outputs formatted deprecation warning messages to console
92
+ */
93
+ createDeprecationWarning() {
94
+ // Import LogFormatter to format system messages properly
95
+ const { LogFormatter } = require('../formatter');
96
+ console.warn(LogFormatter.formatSystemMessage('⚠️ DEPRECATION WARNING: The "level" configuration is deprecated and will be removed in v3.0.0. Please use "mode" instead.'));
97
+ console.warn(LogFormatter.formatSystemMessage(' Migration: LogEngine.configure({ level: LogLevel.DEBUG }) → LogEngine.configure({ mode: LogMode.DEBUG })'));
98
+ console.warn(LogFormatter.formatSystemMessage(' See: https://github.com/wgtechlabs/log-engine#migration-guide-loglevel--logmode'));
99
+ }
100
+ }
101
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/logger/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAG9B;QACE,sEAAsE;QACtE,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI,EAAE,mBAAmB,CAAC,kBAAkB,EAAE;SAC/C,CAAC;IACJ,CAAC;IAED;;;SAGK;IACL,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED;;;;;SAKK;IACL,YAAY,CAAC,MAA6B;QACxC,wEAAwE;QACxE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC5D,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,8BAA8B;YAC9B,sEAAsE;YACtE,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC5D,6DAA6D;gBAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,CAAC;gBAChD,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG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;YACzD,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAM,SAAS;YACzD,KAAK,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAO,6CAA6C;YAC7F,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAkB,qBAAqB;YACrE,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAqB,kBAAkB;YAClE,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC;QAC1B,CAAC;IACH,CAAC;IAED;;;SAGK;IACG,wBAAwB;QAC9B,yDAAyD;QACzD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;QAEjD,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,4HAA4H,CAAC,CAAC,CAAC;QAC7K,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,6GAA6G,CAAC,CAAC,CAAC;QAC9J,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,oFAAoF,CAAC,CAAC,CAAC;IACvI,CAAC;CACF"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Core Logger class that handles log message output with configurable levels
3
+ * Supports DEBUG, INFO, WARN, ERROR, and LOG levels with intelligent filtering
4
+ * LOG level always outputs regardless of configuration
5
+ * Uses colorized console output with timestamps for better readability
6
+ * Includes automatic data redaction for sensitive information
7
+ */
8
+ import { LoggerConfig, LogData } from '../types';
9
+ /**
10
+ * Logger class responsible for managing log output and configuration
11
+ * Provides mode-based filtering and formatted console output
12
+ */
13
+ export declare class Logger {
14
+ private configManager;
15
+ /**
16
+ * Logger constructor - sets up environment-based auto-configuration
17
+ */
18
+ constructor();
19
+ /**
20
+ * Built-in output handlers for common use cases
21
+ */
22
+ private getBuiltInHandler;
23
+ /**
24
+ * Process a single output target with error handling
25
+ * @param output - Single output target to process
26
+ * @param level - Log level
27
+ * @param rawMessage - Original unformatted message
28
+ * @param formattedMessage - Formatted message for console-based outputs
29
+ * @param data - Optional data
30
+ * @param isEnhanced - Whether this is an enhanced output (supports configured handler objects)
31
+ */
32
+ private processSingleOutput;
33
+ /**
34
+ * Process multiple output targets
35
+ * @param outputs - Array of output targets to process
36
+ * @param level - Log level
37
+ * @param rawMessage - Original unformatted message
38
+ * @param formattedMessage - Formatted message for console-based outputs
39
+ * @param data - Optional data
40
+ */
41
+ private processOutputs;
42
+ /**
43
+ * Process enhanced output targets
44
+ * @param enhancedOutputs - Array of enhanced output targets to process
45
+ * @param level - Log level
46
+ * @param rawMessage - Original unformatted message
47
+ * @param formattedMessage - Formatted message for console-based outputs
48
+ * @param data - Optional data
49
+ */
50
+ private processEnhancedOutputs;
51
+ /**
52
+ * Updates logger configuration with new settings
53
+ * Also updates redaction configuration based on environment
54
+ * @param config - Partial configuration object to apply
55
+ */
56
+ configure(config: Partial<LoggerConfig>): void;
57
+ /**
58
+ * Get current logger configuration
59
+ * @returns Current logger configuration
60
+ */
61
+ getConfig(): LoggerConfig;
62
+ /**
63
+ * Determines if a message should be logged based on current log mode
64
+ * @param level - The log level of the message to check
65
+ * @returns true if message should be logged, false otherwise
66
+ */
67
+ private shouldLog;
68
+ /**
69
+ * Writes log output using configured output handler or default console methods
70
+ * Supports single output handler, multiple outputs, and enhanced outputs
71
+ * Priority: outputs > enhancedOutputs > outputHandler > default console
72
+ * @param level - The log level as a string
73
+ * @param rawMessage - The original unformatted message
74
+ * @param formattedMessage - The pre-formatted message to output
75
+ * @param data - Optional data object that was logged
76
+ * @param isError - Whether this is an error level message (for console.error)
77
+ * @param isWarn - Whether this is a warning level message (for console.warn)
78
+ */
79
+ private writeToOutput;
80
+ /**
81
+ * Log a debug message with DEBUG level formatting
82
+ * Uses console.log for output with purple/magenta coloring
83
+ * Automatically redacts sensitive data when provided
84
+ * @param message - The debug message to log
85
+ * @param data - Optional data object to log (will be redacted)
86
+ */
87
+ debug(message: string, data?: LogData): void;
88
+ /**
89
+ * Log an informational message with INFO level formatting
90
+ * Uses console.log for output with blue coloring
91
+ * Automatically redacts sensitive data when provided
92
+ * @param message - The info message to log
93
+ * @param data - Optional data object to log (will be redacted)
94
+ */
95
+ info(message: string, data?: LogData): void;
96
+ /**
97
+ * Log a warning message with WARN level formatting
98
+ * Uses console.warn for output with yellow coloring
99
+ * Automatically redacts sensitive data when provided
100
+ * @param message - The warning message to log
101
+ * @param data - Optional data object to log (will be redacted)
102
+ */
103
+ warn(message: string, data?: LogData): void;
104
+ /**
105
+ * Log an error message with ERROR level formatting
106
+ * Uses console.error for output with red coloring
107
+ * Automatically redacts sensitive data when provided
108
+ * @param message - The error message to log
109
+ * @param data - Optional data object to log (will be redacted)
110
+ */
111
+ error(message: string, data?: LogData): void;
112
+ /**
113
+ * Log a message with LOG level formatting (always outputs unless mode is OFF)
114
+ * Uses console.log for output with green coloring
115
+ * LOG level bypasses normal filtering and always outputs (except when OFF is set)
116
+ * Automatically redacts sensitive data when provided
117
+ * @param message - The log message to output
118
+ * @param data - Optional data object to log (will be redacted)
119
+ */
120
+ log(message: string, data?: LogData): void;
121
+ /**
122
+ * Log a debug message without data redaction
123
+ * @param message - The debug message to log
124
+ * @param data - Optional data object to log (no redaction applied)
125
+ */
126
+ debugRaw(message: string, data?: LogData): void;
127
+ /**
128
+ * Log an info message without data redaction
129
+ * @param message - The info message to log
130
+ * @param data - Optional data object to log (no redaction applied)
131
+ */
132
+ infoRaw(message: string, data?: LogData): void;
133
+ /**
134
+ * Log a warning message without data redaction
135
+ * @param message - The warning message to log
136
+ * @param data - Optional data object to log (no redaction applied)
137
+ */
138
+ warnRaw(message: string, data?: LogData): void;
139
+ /**
140
+ * Log an error message without data redaction
141
+ * @param message - The error message to log
142
+ * @param data - Optional data object to log (no redaction applied)
143
+ */
144
+ errorRaw(message: string, data?: LogData): void;
145
+ /**
146
+ * Log a message without data redaction (always outputs unless mode is OFF)
147
+ * @param message - The log message to output
148
+ * @param data - Optional data object to log (no redaction applied)
149
+ */
150
+ logRaw(message: string, data?: LogData): void;
151
+ }
152
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/logger/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAqB,YAAY,EAAwD,OAAO,EAAE,MAAM,UAAU,CAAC;AAO1H;;;GAGG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,aAAa,CAAsB;IAE3C;;SAEK;;IAKL;;SAEK;IAEL,OAAO,CAAC,iBAAiB;IAsCzB;;;;;;;;SAQK;IACL,OAAO,CAAC,mBAAmB;IA6C3B;;;;;;;SAOK;IACL,OAAO,CAAC,cAAc;IAMtB;;;;;;;SAOK;IACL,OAAO,CAAC,sBAAsB;IAM9B;;;;SAIK;IACL,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAU9C;;;SAGK;IACL,SAAS,IAAI,YAAY;IAIzB;;;;SAIK;IACL,OAAO,CAAC,SAAS;IAMjB;;;;;;;;;;SAUK;IACL,OAAO,CAAC,aAAa;IAkDrB;;;;;;SAMK;IACL,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAQ5C;;;;;;SAMK;IACL,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAQ3C;;;;;;SAMK;IACL,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAQ3C;;;;;;SAMK;IACL,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAQ5C;;;;;;;SAOK;IACL,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAS1C;;;;SAIK;IACL,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAO/C;;;;SAIK;IACL,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAO9C;;;;SAIK;IACL,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAO9C;;;;SAIK;IACL,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAO/C;;;;SAIK;IACL,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;CAM9C"}
@@ -0,0 +1,367 @@
1
+ /**
2
+ * Core Logger class that handles log message output with configurable levels
3
+ * Supports DEBUG, INFO, WARN, ERROR, and LOG levels with intelligent filtering
4
+ * LOG level always outputs regardless of configuration
5
+ * Uses colorized console output with timestamps for better readability
6
+ * Includes automatic data redaction for sensitive information
7
+ */
8
+ import { LogLevel, LogMode } from '../types/index.js';
9
+ import { LogFormatter } from '../formatter/index.js';
10
+ import { DataRedactor, RedactionController, defaultRedactionConfig } from '../redaction/index.js';
11
+ import { LoggerConfigManager } from './config.js';
12
+ import { LogFilter } from './filtering.js';
13
+ import { createBuiltInHandler } from './advanced-outputs.js';
14
+ /**
15
+ * Logger class responsible for managing log output and configuration
16
+ * Provides mode-based filtering and formatted console output
17
+ */
18
+ export class Logger {
19
+ /**
20
+ * Logger constructor - sets up environment-based auto-configuration
21
+ */
22
+ constructor() {
23
+ this.configManager = new LoggerConfigManager();
24
+ }
25
+ /**
26
+ * Built-in output handlers for common use cases
27
+ */
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ getBuiltInHandler(type, config) {
30
+ switch (type) {
31
+ case 'console':
32
+ return (level, message, data) => {
33
+ // Use appropriate console method based on level
34
+ if (level === 'error') {
35
+ if (data !== undefined) {
36
+ console.error(message, data);
37
+ }
38
+ else {
39
+ console.error(message);
40
+ }
41
+ }
42
+ else if (level === 'warn') {
43
+ if (data !== undefined) {
44
+ console.warn(message, data);
45
+ }
46
+ else {
47
+ console.warn(message);
48
+ }
49
+ }
50
+ else {
51
+ if (data !== undefined) {
52
+ console.log(message, data);
53
+ }
54
+ else {
55
+ console.log(message);
56
+ }
57
+ }
58
+ };
59
+ case 'silent':
60
+ return () => {
61
+ // Do nothing - silent output
62
+ };
63
+ case 'file':
64
+ case 'http':
65
+ // Use advanced output handlers for file and http
66
+ return createBuiltInHandler(type, config);
67
+ default:
68
+ return null;
69
+ }
70
+ }
71
+ /**
72
+ * Process a single output target with error handling
73
+ * @param output - Single output target to process
74
+ * @param level - Log level
75
+ * @param rawMessage - Original unformatted message
76
+ * @param formattedMessage - Formatted message for console-based outputs
77
+ * @param data - Optional data
78
+ * @param isEnhanced - Whether this is an enhanced output (supports configured handler objects)
79
+ */
80
+ processSingleOutput(output, level, rawMessage, formattedMessage, data, isEnhanced = false) {
81
+ const config = this.configManager.getConfig();
82
+ try {
83
+ if (typeof output === 'string') {
84
+ // Built-in handler - get config if available
85
+ const outputConfig = config.advancedOutputConfig?.[output];
86
+ const handler = this.getBuiltInHandler(output, outputConfig);
87
+ if (handler) {
88
+ // Advanced handlers (file, http) get raw message, console gets formatted
89
+ const messageToUse = (output === 'file' || output === 'http') ? rawMessage : formattedMessage;
90
+ handler(level, messageToUse, data);
91
+ }
92
+ else {
93
+ console.error('[LogEngine] Unknown built-in output handler:', JSON.stringify(output));
94
+ }
95
+ }
96
+ else if (typeof output === 'function') {
97
+ // Custom function handler gets formatted message for backward compatibility
98
+ output(level, formattedMessage, data);
99
+ }
100
+ else if (isEnhanced && typeof output === 'object' && output.type && output.config) {
101
+ // Configured handler object (only available for enhanced outputs)
102
+ const handler = this.getBuiltInHandler(output.type, output.config);
103
+ if (handler) {
104
+ // Advanced configured handlers get raw message
105
+ handler(level, rawMessage, data);
106
+ }
107
+ else {
108
+ console.error('[LogEngine] Unknown enhanced output handler type:', JSON.stringify(output));
109
+ }
110
+ }
111
+ else {
112
+ const outputType = isEnhanced ? 'enhanced output target' : 'output target';
113
+ console.error(`[LogEngine] Invalid ${outputType}:`, output);
114
+ }
115
+ }
116
+ catch (error) {
117
+ // Continue processing other outputs even if one fails
118
+ const handlerType = isEnhanced ? 'Enhanced output' : 'Output';
119
+ console.error(`[LogEngine] ${handlerType} handler failed: ${error}`);
120
+ }
121
+ }
122
+ /**
123
+ * Process multiple output targets
124
+ * @param outputs - Array of output targets to process
125
+ * @param level - Log level
126
+ * @param rawMessage - Original unformatted message
127
+ * @param formattedMessage - Formatted message for console-based outputs
128
+ * @param data - Optional data
129
+ */
130
+ processOutputs(outputs, level, rawMessage, formattedMessage, data) {
131
+ for (const output of outputs) {
132
+ this.processSingleOutput(output, level, rawMessage, formattedMessage, data, false);
133
+ }
134
+ }
135
+ /**
136
+ * Process enhanced output targets
137
+ * @param enhancedOutputs - Array of enhanced output targets to process
138
+ * @param level - Log level
139
+ * @param rawMessage - Original unformatted message
140
+ * @param formattedMessage - Formatted message for console-based outputs
141
+ * @param data - Optional data
142
+ */
143
+ processEnhancedOutputs(enhancedOutputs, level, rawMessage, formattedMessage, data) {
144
+ for (const output of enhancedOutputs) {
145
+ this.processSingleOutput(output, level, rawMessage, formattedMessage, data, true);
146
+ }
147
+ }
148
+ /**
149
+ * Updates logger configuration with new settings
150
+ * Also updates redaction configuration based on environment
151
+ * @param config - Partial configuration object to apply
152
+ */
153
+ configure(config) {
154
+ this.configManager.updateConfig(config);
155
+ // Update redaction configuration based on current environment
156
+ DataRedactor.updateConfig({
157
+ ...defaultRedactionConfig,
158
+ ...RedactionController.getEnvironmentConfig()
159
+ });
160
+ }
161
+ /**
162
+ * Get current logger configuration
163
+ * @returns Current logger configuration
164
+ */
165
+ getConfig() {
166
+ return this.configManager.getConfig();
167
+ }
168
+ /**
169
+ * Determines if a message should be logged based on current log mode
170
+ * @param level - The log level of the message to check
171
+ * @returns true if message should be logged, false otherwise
172
+ */
173
+ shouldLog(level) {
174
+ const currentConfig = this.configManager.getConfig();
175
+ const currentMode = currentConfig.mode !== undefined ? currentConfig.mode : LogMode.INFO;
176
+ return LogFilter.shouldLog(level, currentMode);
177
+ }
178
+ /**
179
+ * Writes log output using configured output handler or default console methods
180
+ * Supports single output handler, multiple outputs, and enhanced outputs
181
+ * Priority: outputs > enhancedOutputs > outputHandler > default console
182
+ * @param level - The log level as a string
183
+ * @param rawMessage - The original unformatted message
184
+ * @param formattedMessage - The pre-formatted message to output
185
+ * @param data - Optional data object that was logged
186
+ * @param isError - Whether this is an error level message (for console.error)
187
+ * @param isWarn - Whether this is a warning level message (for console.warn)
188
+ */
189
+ writeToOutput(level, rawMessage, formattedMessage, data, isError = false, isWarn = false) {
190
+ const config = this.configManager.getConfig();
191
+ // Multiple outputs support (highest priority - newer API)
192
+ if (config.outputs !== undefined) {
193
+ if (config.outputs.length > 0) {
194
+ // Process outputs array when it has actual outputs
195
+ this.processOutputs(config.outputs, level, rawMessage, formattedMessage, data);
196
+ }
197
+ // If outputs is explicitly set to empty array, disable all logging
198
+ return;
199
+ }
200
+ // Enhanced outputs with advanced configuration (second priority)
201
+ if (config.enhancedOutputs !== undefined && config.enhancedOutputs.length > 0) {
202
+ this.processEnhancedOutputs(config.enhancedOutputs, level, rawMessage, formattedMessage, data);
203
+ return;
204
+ }
205
+ // Single output handler (third priority - legacy compatibility)
206
+ if (config.outputHandler) {
207
+ try {
208
+ config.outputHandler(level, formattedMessage, data);
209
+ }
210
+ catch (error) {
211
+ // Fallback to console if custom handler fails
212
+ console.error(`[LogEngine] Output handler failed: ${error}. Falling back to console.`);
213
+ if (isError) {
214
+ console.error(formattedMessage);
215
+ }
216
+ else if (isWarn) {
217
+ console.warn(formattedMessage);
218
+ }
219
+ else {
220
+ console.log(formattedMessage);
221
+ }
222
+ }
223
+ return;
224
+ }
225
+ // Default: Console output (unless suppressed)
226
+ if (!config.suppressConsoleOutput) {
227
+ if (isError) {
228
+ console.error(formattedMessage);
229
+ }
230
+ else if (isWarn) {
231
+ console.warn(formattedMessage);
232
+ }
233
+ else {
234
+ console.log(formattedMessage);
235
+ }
236
+ }
237
+ // If suppressConsoleOutput is true and no outputHandler/outputs, do nothing (silent)
238
+ }
239
+ /**
240
+ * Log a debug message with DEBUG level formatting
241
+ * Uses console.log for output with purple/magenta coloring
242
+ * Automatically redacts sensitive data when provided
243
+ * @param message - The debug message to log
244
+ * @param data - Optional data object to log (will be redacted)
245
+ */
246
+ debug(message, data) {
247
+ if (this.shouldLog(LogLevel.DEBUG)) {
248
+ const processedData = DataRedactor.redactData(data);
249
+ const formatted = LogFormatter.format(LogLevel.DEBUG, message, processedData);
250
+ this.writeToOutput('debug', message, formatted, processedData);
251
+ }
252
+ }
253
+ /**
254
+ * Log an informational message with INFO level formatting
255
+ * Uses console.log for output with blue coloring
256
+ * Automatically redacts sensitive data when provided
257
+ * @param message - The info message to log
258
+ * @param data - Optional data object to log (will be redacted)
259
+ */
260
+ info(message, data) {
261
+ if (this.shouldLog(LogLevel.INFO)) {
262
+ const processedData = DataRedactor.redactData(data);
263
+ const formatted = LogFormatter.format(LogLevel.INFO, message, processedData);
264
+ this.writeToOutput('info', message, formatted, processedData);
265
+ }
266
+ }
267
+ /**
268
+ * Log a warning message with WARN level formatting
269
+ * Uses console.warn for output with yellow coloring
270
+ * Automatically redacts sensitive data when provided
271
+ * @param message - The warning message to log
272
+ * @param data - Optional data object to log (will be redacted)
273
+ */
274
+ warn(message, data) {
275
+ if (this.shouldLog(LogLevel.WARN)) {
276
+ const processedData = DataRedactor.redactData(data);
277
+ const formatted = LogFormatter.format(LogLevel.WARN, message, processedData);
278
+ this.writeToOutput('warn', message, formatted, processedData, false, true);
279
+ }
280
+ }
281
+ /**
282
+ * Log an error message with ERROR level formatting
283
+ * Uses console.error for output with red coloring
284
+ * Automatically redacts sensitive data when provided
285
+ * @param message - The error message to log
286
+ * @param data - Optional data object to log (will be redacted)
287
+ */
288
+ error(message, data) {
289
+ if (this.shouldLog(LogLevel.ERROR)) {
290
+ const processedData = DataRedactor.redactData(data);
291
+ const formatted = LogFormatter.format(LogLevel.ERROR, message, processedData);
292
+ this.writeToOutput('error', message, formatted, processedData, true, false);
293
+ }
294
+ }
295
+ /**
296
+ * Log a message with LOG level formatting (always outputs unless mode is OFF)
297
+ * Uses console.log for output with green coloring
298
+ * LOG level bypasses normal filtering and always outputs (except when OFF is set)
299
+ * Automatically redacts sensitive data when provided
300
+ * @param message - The log message to output
301
+ * @param data - Optional data object to log (will be redacted)
302
+ */
303
+ log(message, data) {
304
+ if (this.shouldLog(LogLevel.LOG)) {
305
+ const processedData = DataRedactor.redactData(data);
306
+ const formatted = LogFormatter.format(LogLevel.LOG, message, processedData);
307
+ this.writeToOutput('log', message, formatted, processedData);
308
+ }
309
+ }
310
+ // Raw logging methods (bypass redaction for debugging)
311
+ /**
312
+ * Log a debug message without data redaction
313
+ * @param message - The debug message to log
314
+ * @param data - Optional data object to log (no redaction applied)
315
+ */
316
+ debugRaw(message, data) {
317
+ if (this.shouldLog(LogLevel.DEBUG)) {
318
+ const formatted = LogFormatter.format(LogLevel.DEBUG, message, data);
319
+ this.writeToOutput('debug', message, formatted, data);
320
+ }
321
+ }
322
+ /**
323
+ * Log an info message without data redaction
324
+ * @param message - The info message to log
325
+ * @param data - Optional data object to log (no redaction applied)
326
+ */
327
+ infoRaw(message, data) {
328
+ if (this.shouldLog(LogLevel.INFO)) {
329
+ const formatted = LogFormatter.format(LogLevel.INFO, message, data);
330
+ this.writeToOutput('info', message, formatted, data);
331
+ }
332
+ }
333
+ /**
334
+ * Log a warning message without data redaction
335
+ * @param message - The warning message to log
336
+ * @param data - Optional data object to log (no redaction applied)
337
+ */
338
+ warnRaw(message, data) {
339
+ if (this.shouldLog(LogLevel.WARN)) {
340
+ const formatted = LogFormatter.format(LogLevel.WARN, message, data);
341
+ this.writeToOutput('warn', message, formatted, data, false, true);
342
+ }
343
+ }
344
+ /**
345
+ * Log an error message without data redaction
346
+ * @param message - The error message to log
347
+ * @param data - Optional data object to log (no redaction applied)
348
+ */
349
+ errorRaw(message, data) {
350
+ if (this.shouldLog(LogLevel.ERROR)) {
351
+ const formatted = LogFormatter.format(LogLevel.ERROR, message, data);
352
+ this.writeToOutput('error', message, formatted, data, true, false);
353
+ }
354
+ }
355
+ /**
356
+ * Log a message without data redaction (always outputs unless mode is OFF)
357
+ * @param message - The log message to output
358
+ * @param data - Optional data object to log (no redaction applied)
359
+ */
360
+ logRaw(message, data) {
361
+ if (this.shouldLog(LogLevel.LOG)) {
362
+ const formatted = LogFormatter.format(LogLevel.LOG, message, data);
363
+ this.writeToOutput('log', message, formatted, data);
364
+ }
365
+ }
366
+ }
367
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/logger/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA+E,MAAM,UAAU,CAAC;AAC1H,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,MAAM;IAGjB;;SAEK;IACL;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACjD,CAAC;IAED;;SAEK;IACL,8DAA8D;IACtD,iBAAiB,CAAC,IAAY,EAAE,MAAY;QAClD,QAAQ,IAAI,EAAE,CAAC;YACf,KAAK,SAAS;gBACZ,OAAO,CAAC,KAA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