@mks2508/better-logger 0.14.0-alpha.1 → 1.0.0

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 (145) hide show
  1. package/dist/chunks/{Logger-BW-kn5_7.js → Logger-CTAaDeZi.js} +49 -366
  2. package/dist/chunks/Logger-CTAaDeZi.js.map +1 -0
  3. package/dist/chunks/Logger-D8pK7XXt.js +2 -0
  4. package/dist/chunks/Logger-D8pK7XXt.js.map +1 -0
  5. package/dist/chunks/ScopedLogger-D-7q8uVP.js +2 -0
  6. package/dist/chunks/ScopedLogger-D-7q8uVP.js.map +1 -0
  7. package/dist/chunks/ScopedLogger-hS0qSkZD.js +361 -0
  8. package/dist/chunks/ScopedLogger-hS0qSkZD.js.map +1 -0
  9. package/dist/core.js +280 -307
  10. package/dist/exports.cjs +1 -1
  11. package/dist/exports.js +1 -1
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.js +226 -159
  15. package/dist/index.js.map +1 -1
  16. package/dist/styling.cjs +1 -1
  17. package/dist/styling.js +2 -2
  18. package/dist/types/Logger.d.ts +17 -15
  19. package/dist/types/Logger.d.ts.map +1 -1
  20. package/dist/types/core.d.ts +122 -216
  21. package/dist/types/core.d.ts.map +1 -1
  22. package/dist/types/exports-module.d.ts +1 -1
  23. package/dist/types/exports-module.d.ts.map +1 -1
  24. package/dist/types/index.d.ts +119 -4
  25. package/dist/types/index.d.ts.map +1 -1
  26. package/dist/types/styling-module.d.ts +1 -1
  27. package/dist/types/styling-module.d.ts.map +1 -1
  28. package/package.json +2 -1
  29. package/src/Logger.ts +105 -58
  30. package/src/index.ts +32 -25
  31. package/dist/.tsbuildinfo +0 -1
  32. package/dist/Logger.d.ts +0 -710
  33. package/dist/Logger.d.ts.map +0 -1
  34. package/dist/Logger.js +0 -1118
  35. package/dist/ScopedLogger.d.ts +0 -318
  36. package/dist/ScopedLogger.d.ts.map +0 -1
  37. package/dist/ScopedLogger.js +0 -426
  38. package/dist/chunks/Logger-BW-kn5_7.js.map +0 -1
  39. package/dist/chunks/Logger-BpeuYIxR.js +0 -2
  40. package/dist/chunks/Logger-BpeuYIxR.js.map +0 -1
  41. package/dist/cli/CommandProcessor.d.ts +0 -103
  42. package/dist/cli/CommandProcessor.d.ts.map +0 -1
  43. package/dist/cli/CommandProcessor.js +0 -184
  44. package/dist/cli/commands/ConfigCommand.d.ts +0 -17
  45. package/dist/cli/commands/ConfigCommand.d.ts.map +0 -1
  46. package/dist/cli/commands/ConfigCommand.js +0 -88
  47. package/dist/cli/commands/ExportCommand.d.ts +0 -51
  48. package/dist/cli/commands/ExportCommand.d.ts.map +0 -1
  49. package/dist/cli/commands/ExportCommand.js +0 -243
  50. package/dist/cli/commands/HistoryCommand.d.ts +0 -50
  51. package/dist/cli/commands/HistoryCommand.d.ts.map +0 -1
  52. package/dist/cli/commands/HistoryCommand.js +0 -96
  53. package/dist/cli/commands/StatusCommand.d.ts +0 -33
  54. package/dist/cli/commands/StatusCommand.d.ts.map +0 -1
  55. package/dist/cli/commands/StatusCommand.js +0 -93
  56. package/dist/cli/commands/ThemeCommand.d.ts +0 -33
  57. package/dist/cli/commands/ThemeCommand.d.ts.map +0 -1
  58. package/dist/cli/commands/ThemeCommand.js +0 -79
  59. package/dist/cli/help.d.ts +0 -15
  60. package/dist/cli/help.d.ts.map +0 -1
  61. package/dist/cli/help.js +0 -118
  62. package/dist/cli/index.d.ts +0 -15
  63. package/dist/cli/index.d.ts.map +0 -1
  64. package/dist/cli/index.js +0 -46
  65. package/dist/constants.d.ts +0 -122
  66. package/dist/constants.d.ts.map +0 -1
  67. package/dist/constants.js +0 -159
  68. package/dist/core.d.ts +0 -134
  69. package/dist/core.d.ts.map +0 -1
  70. package/dist/example.d.ts +0 -18
  71. package/dist/example.d.ts.map +0 -1
  72. package/dist/example.js +0 -154
  73. package/dist/exports-module.d.ts +0 -203
  74. package/dist/exports-module.d.ts.map +0 -1
  75. package/dist/exports-module.js +0 -260
  76. package/dist/handlers/AnalyticsLogHandler.d.ts +0 -11
  77. package/dist/handlers/AnalyticsLogHandler.d.ts.map +0 -1
  78. package/dist/handlers/AnalyticsLogHandler.js +0 -19
  79. package/dist/handlers/ExportLogHandler.d.ts +0 -103
  80. package/dist/handlers/ExportLogHandler.d.ts.map +0 -1
  81. package/dist/handlers/ExportLogHandler.js +0 -516
  82. package/dist/handlers/FileLogHandler.d.ts +0 -36
  83. package/dist/handlers/FileLogHandler.d.ts.map +0 -1
  84. package/dist/handlers/FileLogHandler.js +0 -156
  85. package/dist/handlers/RemoteLogHandler.d.ts +0 -14
  86. package/dist/handlers/RemoteLogHandler.d.ts.map +0 -1
  87. package/dist/handlers/RemoteLogHandler.js +0 -37
  88. package/dist/handlers/index.d.ts +0 -8
  89. package/dist/handlers/index.d.ts.map +0 -1
  90. package/dist/handlers/index.js +0 -7
  91. package/dist/index.d.ts +0 -157
  92. package/dist/index.d.ts.map +0 -1
  93. package/dist/main.d.ts +0 -2
  94. package/dist/main.d.ts.map +0 -1
  95. package/dist/main.js +0 -139
  96. package/dist/styling/LogStyleBuilder.d.ts +0 -149
  97. package/dist/styling/LogStyleBuilder.d.ts.map +0 -1
  98. package/dist/styling/LogStyleBuilder.js +0 -289
  99. package/dist/styling/SemanticStyles.d.ts +0 -181
  100. package/dist/styling/SemanticStyles.d.ts.map +0 -1
  101. package/dist/styling/SemanticStyles.js +0 -339
  102. package/dist/styling/SmartPresets.d.ts +0 -25
  103. package/dist/styling/SmartPresets.d.ts.map +0 -1
  104. package/dist/styling/SmartPresets.js +0 -276
  105. package/dist/styling/StyleBuilder.d.ts +0 -140
  106. package/dist/styling/StyleBuilder.d.ts.map +0 -1
  107. package/dist/styling/StyleBuilder.js +0 -280
  108. package/dist/styling/banners.d.ts +0 -45
  109. package/dist/styling/banners.d.ts.map +0 -1
  110. package/dist/styling/banners.js +0 -155
  111. package/dist/styling/index.d.ts +0 -10
  112. package/dist/styling/index.d.ts.map +0 -1
  113. package/dist/styling/index.js +0 -9
  114. package/dist/styling/themes.d.ts +0 -10
  115. package/dist/styling/themes.d.ts.map +0 -1
  116. package/dist/styling/themes.js +0 -231
  117. package/dist/styling-module.d.ts +0 -185
  118. package/dist/styling-module.d.ts.map +0 -1
  119. package/dist/styling-module.js +0 -199
  120. package/dist/types/core.js +0 -28
  121. package/dist/types/handlers.d.ts +0 -88
  122. package/dist/types/handlers.d.ts.map +0 -1
  123. package/dist/types/handlers.js +0 -4
  124. package/dist/types/index.js +0 -4
  125. package/dist/utils/environment.d.ts +0 -47
  126. package/dist/utils/environment.d.ts.map +0 -1
  127. package/dist/utils/environment.js +0 -85
  128. package/dist/utils/formatting.d.ts +0 -40
  129. package/dist/utils/formatting.d.ts.map +0 -1
  130. package/dist/utils/formatting.js +0 -117
  131. package/dist/utils/index.d.ts +0 -7
  132. package/dist/utils/index.d.ts.map +0 -1
  133. package/dist/utils/index.js +0 -6
  134. package/dist/utils/opentui-detection.d.ts +0 -34
  135. package/dist/utils/opentui-detection.d.ts.map +0 -1
  136. package/dist/utils/opentui-detection.js +0 -116
  137. package/dist/utils/output.d.ts +0 -44
  138. package/dist/utils/output.d.ts.map +0 -1
  139. package/dist/utils/output.js +0 -150
  140. package/dist/utils/stackTrace.d.ts +0 -9
  141. package/dist/utils/stackTrace.d.ts.map +0 -1
  142. package/dist/utils/stackTrace.js +0 -81
  143. package/dist/utils/timestamps.d.ts +0 -20
  144. package/dist/utils/timestamps.d.ts.map +0 -1
  145. package/dist/utils/timestamps.js +0 -71
@@ -1,103 +0,0 @@
1
- /**
2
- * @fileoverview CLI Command processor for Advanced Logger
3
- */
4
- import type { Logger } from '../Logger.js';
5
- /**
6
- * Base interface for CLI commands
7
- */
8
- export interface ICommand {
9
- name: string;
10
- description: string;
11
- usage: string;
12
- category?: string;
13
- aliases?: string[];
14
- execute(args: string, logger: Logger): void | Promise<void>;
15
- }
16
- /**
17
- * Plugin interface for extending CLI functionality
18
- */
19
- export interface ICLIPlugin {
20
- name: string;
21
- version: string;
22
- description: string;
23
- commands: ICommand[];
24
- initialize?(processor: CommandProcessor, logger: Logger): void;
25
- cleanup?(): void;
26
- }
27
- /**
28
- * Command history entry
29
- */
30
- interface HistoryEntry {
31
- command: string;
32
- timestamp: Date;
33
- success: boolean;
34
- }
35
- /**
36
- * CLI command processor
37
- */
38
- export declare class CommandProcessor {
39
- private commands;
40
- private aliases;
41
- private plugins;
42
- private history;
43
- private maxHistorySize;
44
- private isInteractiveMode;
45
- /**
46
- * Register a command
47
- */
48
- registerCommand(command: ICommand): void;
49
- /**
50
- * Register a plugin
51
- */
52
- registerPlugin(plugin: ICLIPlugin, logger?: Logger): void;
53
- /**
54
- * Unregister a plugin
55
- */
56
- unregisterPlugin(pluginName: string): void;
57
- /**
58
- * Get all registered commands
59
- */
60
- getCommands(): ICommand[];
61
- /**
62
- * Get a specific command
63
- */
64
- getCommand(name: string): ICommand | undefined;
65
- /**
66
- * Get command history
67
- */
68
- getHistory(): HistoryEntry[];
69
- /**
70
- * Clear command history
71
- */
72
- clearHistory(): void;
73
- /**
74
- * Get registered plugins
75
- */
76
- getPlugins(): ICLIPlugin[];
77
- /**
78
- * Enter interactive mode
79
- */
80
- enterInteractiveMode(logger: Logger): void;
81
- /**
82
- * Exit interactive mode
83
- */
84
- exitInteractiveMode(): void;
85
- /**
86
- * Setup browser interactive mode
87
- */
88
- private setupBrowserInteractiveMode;
89
- /**
90
- * Process a CLI command
91
- */
92
- processCommand(commandString: string, logger: Logger): Promise<void>;
93
- /**
94
- * Add command to history
95
- */
96
- private addToHistory;
97
- /**
98
- * Get command suggestions for partial matches
99
- */
100
- getSuggestions(partial: string): string[];
101
- }
102
- export {};
103
- //# sourceMappingURL=CommandProcessor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandProcessor.d.ts","sourceRoot":"","sources":["../../src/cli/CommandProcessor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,UAAU,CAAC,CAAC,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/D,OAAO,CAAC,IAAI,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,UAAU,YAAY;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,cAAc,CAAe;IACrC,OAAO,CAAC,iBAAiB,CAAkB;IAE3C;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI;IAWxC;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAkBzD;;OAEG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAsB1C;;OAEG;IACH,WAAW,IAAI,QAAQ,EAAE;IAIzB;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAc9C;;OAEG;IACH,UAAU,IAAI,YAAY,EAAE;IAI5B;;OAEG;IACH,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,UAAU,IAAI,UAAU,EAAE;IAI1B;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAU1C;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAI3B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IASnC;;OAEG;IACG,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkC1E;;OAEG;IACH,OAAO,CAAC,YAAY;IAapB;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;CAI5C"}
@@ -1,184 +0,0 @@
1
- /**
2
- * @fileoverview CLI Command processor for Advanced Logger
3
- */
4
- /**
5
- * CLI command processor
6
- */
7
- export class CommandProcessor {
8
- commands = new Map();
9
- aliases = new Map();
10
- plugins = new Map();
11
- history = [];
12
- maxHistorySize = 100;
13
- isInteractiveMode = false;
14
- /**
15
- * Register a command
16
- */
17
- registerCommand(command) {
18
- this.commands.set(command.name, command);
19
- // Register aliases
20
- if (command.aliases) {
21
- for (const alias of command.aliases) {
22
- this.aliases.set(alias, command.name);
23
- }
24
- }
25
- }
26
- /**
27
- * Register a plugin
28
- */
29
- registerPlugin(plugin, logger) {
30
- if (this.plugins.has(plugin.name)) {
31
- throw new Error(`Plugin ${plugin.name} is already registered`);
32
- }
33
- this.plugins.set(plugin.name, plugin);
34
- // Register plugin commands
35
- for (const command of plugin.commands) {
36
- this.registerCommand(command);
37
- }
38
- // Initialize plugin
39
- if (plugin.initialize && logger) {
40
- plugin.initialize(this, logger);
41
- }
42
- }
43
- /**
44
- * Unregister a plugin
45
- */
46
- unregisterPlugin(pluginName) {
47
- const plugin = this.plugins.get(pluginName);
48
- if (!plugin)
49
- return;
50
- // Remove plugin commands
51
- for (const command of plugin.commands) {
52
- this.commands.delete(command.name);
53
- if (command.aliases) {
54
- for (const alias of command.aliases) {
55
- this.aliases.delete(alias);
56
- }
57
- }
58
- }
59
- // Cleanup plugin
60
- if (plugin.cleanup) {
61
- plugin.cleanup();
62
- }
63
- this.plugins.delete(pluginName);
64
- }
65
- /**
66
- * Get all registered commands
67
- */
68
- getCommands() {
69
- return Array.from(this.commands.values());
70
- }
71
- /**
72
- * Get a specific command
73
- */
74
- getCommand(name) {
75
- // Check direct command name
76
- let command = this.commands.get(name);
77
- if (command)
78
- return command;
79
- // Check aliases
80
- const aliasTarget = this.aliases.get(name);
81
- if (aliasTarget) {
82
- return this.commands.get(aliasTarget);
83
- }
84
- return undefined;
85
- }
86
- /**
87
- * Get command history
88
- */
89
- getHistory() {
90
- return [...this.history];
91
- }
92
- /**
93
- * Clear command history
94
- */
95
- clearHistory() {
96
- this.history = [];
97
- }
98
- /**
99
- * Get registered plugins
100
- */
101
- getPlugins() {
102
- return Array.from(this.plugins.values());
103
- }
104
- /**
105
- * Enter interactive mode
106
- */
107
- enterInteractiveMode(logger) {
108
- this.isInteractiveMode = true;
109
- logger.info('🔧 Interactive CLI mode activated. Type /exit to quit, /help for commands.');
110
- // Set up browser console listener for interactive commands
111
- if (typeof window !== 'undefined') {
112
- this.setupBrowserInteractiveMode(logger);
113
- }
114
- }
115
- /**
116
- * Exit interactive mode
117
- */
118
- exitInteractiveMode() {
119
- this.isInteractiveMode = false;
120
- }
121
- /**
122
- * Setup browser interactive mode
123
- */
124
- setupBrowserInteractiveMode(logger) {
125
- // Add global CLI function for browser usage
126
- window.cli = (commandString) => {
127
- return this.processCommand(`/${commandString}`, logger);
128
- };
129
- logger.info('💡 Use cli("command") to execute CLI commands in browser console.');
130
- }
131
- /**
132
- * Process a CLI command
133
- */
134
- async processCommand(commandString, logger) {
135
- if (!commandString.startsWith('/')) {
136
- logger.error('Invalid command. Commands must start with /');
137
- this.addToHistory(commandString, false);
138
- return;
139
- }
140
- const parts = commandString.slice(1).split(' ');
141
- const commandName = parts[0] || '';
142
- const args = parts.slice(1).join(' ');
143
- const command = this.getCommand(commandName);
144
- if (!command) {
145
- logger.error(`Unknown command: ${commandName}. Type /help for available commands.`);
146
- // Suggest similar commands
147
- const suggestions = this.getSuggestions(commandName);
148
- if (suggestions.length > 0) {
149
- logger.info(`📋 Did you mean: ${suggestions.slice(0, 3).join(', ')}?`);
150
- }
151
- this.addToHistory(commandString, false);
152
- return;
153
- }
154
- try {
155
- await command.execute(args || '', logger);
156
- this.addToHistory(commandString, true);
157
- }
158
- catch (error) {
159
- logger.error(`Command '${commandName}' failed:`, error);
160
- this.addToHistory(commandString, false);
161
- }
162
- }
163
- /**
164
- * Add command to history
165
- */
166
- addToHistory(command, success) {
167
- this.history.unshift({
168
- command,
169
- timestamp: new Date(),
170
- success
171
- });
172
- // Limit history size
173
- if (this.history.length > this.maxHistorySize) {
174
- this.history = this.history.slice(0, this.maxHistorySize);
175
- }
176
- }
177
- /**
178
- * Get command suggestions for partial matches
179
- */
180
- getSuggestions(partial) {
181
- const commandNames = Array.from(this.commands.keys());
182
- return commandNames.filter(name => name.startsWith(partial));
183
- }
184
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * @fileoverview Configuration commands for Advanced Logger CLI
3
- */
4
- import type { ICommand } from '../CommandProcessor.js';
5
- import type { Logger } from '../../Logger.js';
6
- /**
7
- * Configuration command handler
8
- */
9
- export declare class ConfigCommand implements ICommand {
10
- name: string;
11
- description: string;
12
- usage: string;
13
- execute(args: string, logger: Logger): void;
14
- private showStatus;
15
- private applyConfig;
16
- }
17
- //# sourceMappingURL=ConfigCommand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfigCommand.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ConfigCommand.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;GAEG;AACH,qBAAa,aAAc,YAAW,QAAQ;IAC1C,IAAI,SAAY;IAChB,WAAW,SAAyC;IACpD,KAAK,SAAkC;IAEvC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IA4B3C,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,WAAW;CA+BtB"}
@@ -1,88 +0,0 @@
1
- /**
2
- * @fileoverview Configuration commands for Advanced Logger CLI
3
- */
4
- /**
5
- * Configuration command handler
6
- */
7
- export class ConfigCommand {
8
- name = 'config';
9
- description = 'Show or update logger configuration';
10
- usage = '/config [json|key=value,...]';
11
- execute(args, logger) {
12
- if (!args) {
13
- this.showStatus(logger);
14
- return;
15
- }
16
- try {
17
- // Try to parse as JSON first
18
- if (args.startsWith('{')) {
19
- const config = JSON.parse(args);
20
- this.applyConfig(config, logger);
21
- }
22
- else {
23
- // Parse key=value pairs
24
- const pairs = args.split(',').map(pair => pair.trim().split('='));
25
- const config = {};
26
- pairs.forEach(([key, value]) => {
27
- if (key && value) {
28
- config[key.trim()] = value.trim().replace(/["']/g, '');
29
- }
30
- });
31
- this.applyConfig(config, logger);
32
- }
33
- }
34
- catch (error) {
35
- logger.error('Invalid config format. Use JSON or key=value pairs:', error);
36
- logger.info('Examples: /config {"theme":"dark"} or /config theme=neon,verbosity=debug');
37
- }
38
- }
39
- showStatus(logger) {
40
- const statusData = {
41
- theme: logger.getConfig().theme || 'default',
42
- verbosity: logger.getConfig().verbosity,
43
- colors: logger.getConfig().enableColors,
44
- timestamps: logger.getConfig().enableTimestamps,
45
- stackTrace: logger.getConfig().enableStackTrace,
46
- globalPrefix: logger.getConfig().globalPrefix || 'none',
47
- bannerType: logger.getConfig().bannerType || 'simple',
48
- handlers: logger.getHandlers().length
49
- };
50
- logger.group('⚙️ Logger Configuration');
51
- logger.table(statusData);
52
- logger.groupEnd();
53
- }
54
- applyConfig(config, logger) {
55
- const validKeys = ['theme', 'verbosity', 'enableColors', 'enableTimestamps', 'enableStackTrace', 'globalPrefix', 'bannerType'];
56
- const applied = [];
57
- Object.entries(config).forEach(([key, value]) => {
58
- if (validKeys.includes(key)) {
59
- if (key === 'theme' && typeof value === 'string') {
60
- logger.setTheme(value);
61
- applied.push(`${key}=${value}`);
62
- }
63
- else if (key === 'bannerType' && typeof value === 'string') {
64
- logger.setBannerType(value);
65
- applied.push(`${key}=${value}`);
66
- }
67
- else if (key === 'verbosity') {
68
- logger.setVerbosity(value);
69
- applied.push(`${key}=${value}`);
70
- }
71
- else if (key === 'globalPrefix') {
72
- logger.setGlobalPrefix(value);
73
- applied.push(`${key}=${value}`);
74
- }
75
- else {
76
- logger.updateConfig({ [key]: value });
77
- applied.push(`${key}=${value}`);
78
- }
79
- }
80
- else {
81
- logger.warn(`Invalid config key: ${key}`);
82
- }
83
- });
84
- if (applied.length > 0) {
85
- logger.success(`Configuration updated: ${applied.join(', ')}`);
86
- }
87
- }
88
- }
@@ -1,51 +0,0 @@
1
- /**
2
- * @fileoverview Export and clipboard commands for Advanced Logger CLI
3
- */
4
- import type { ICommand } from '../CommandProcessor.js';
5
- import type { Logger } from '../../Logger.js';
6
- /**
7
- * Export command - export logs in various formats
8
- */
9
- export declare class ExportCommand implements ICommand {
10
- name: string;
11
- description: string;
12
- usage: string;
13
- execute(args: string, logger: Logger): void;
14
- }
15
- /**
16
- * Copy command - copy logs to clipboard
17
- */
18
- export declare class CopyCommand implements ICommand {
19
- name: string;
20
- description: string;
21
- usage: string;
22
- execute(args: string, logger: Logger): Promise<void>;
23
- }
24
- /**
25
- * Buffer-size command - configure buffer size
26
- */
27
- export declare class BufferSizeCommand implements ICommand {
28
- name: string;
29
- description: string;
30
- usage: string;
31
- execute(args: string, logger: Logger): void;
32
- }
33
- /**
34
- * Clear-buffer command - clear log buffer
35
- */
36
- export declare class ClearBufferCommand implements ICommand {
37
- name: string;
38
- description: string;
39
- usage: string;
40
- execute(_args: string, logger: Logger): void;
41
- }
42
- /**
43
- * Buffer-info command - show buffer information
44
- */
45
- export declare class BufferInfoCommand implements ICommand {
46
- name: string;
47
- description: string;
48
- usage: string;
49
- execute(_args: string, logger: Logger): void;
50
- }
51
- //# sourceMappingURL=ExportCommand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExportCommand.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ExportCommand.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAiG9C;;GAEG;AACH,qBAAa,aAAc,YAAW,QAAQ;IAC1C,IAAI,SAAY;IAChB,WAAW,SAAoC;IAC/C,KAAK,SAAkD;IAEvD,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CA2C9C;AAED;;GAEG;AACH,qBAAa,WAAY,YAAW,QAAQ;IACxC,IAAI,SAAU;IACd,WAAW,SAA4B;IACvC,KAAK,SAAgD;IAE/C,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA8B7D;AAED;;GAEG;AACH,qBAAa,iBAAkB,YAAW,QAAQ;IAC9C,IAAI,SAAiB;IACrB,WAAW,SAAyB;IACpC,KAAK,SAAyB;IAE9B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAiB9C;AAED;;GAEG;AACH,qBAAa,kBAAmB,YAAW,QAAQ;IAC/C,IAAI,SAAkB;IACtB,WAAW,SAA0B;IACrC,KAAK,SAAmB;IAExB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAY/C;AAED;;GAEG;AACH,qBAAa,iBAAkB,YAAW,QAAQ;IAC9C,IAAI,SAAiB;IACrB,WAAW,SAA4C;IACvD,KAAK,SAAkB;IAEvB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAuB/C"}