@mks2508/better-logger 0.14.0-alpha.2 → 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.
- package/dist/chunks/{Logger-Crw1woqR.js → Logger-CTAaDeZi.js} +49 -16
- package/dist/chunks/{Logger-Crw1woqR.js.map → Logger-CTAaDeZi.js.map} +1 -1
- package/dist/chunks/{Logger-D_p3xnbq.js → Logger-D8pK7XXt.js} +2 -2
- package/dist/chunks/{Logger-D_p3xnbq.js.map → Logger-D8pK7XXt.js.map} +1 -1
- package/dist/chunks/ScopedLogger-D-7q8uVP.js +2 -0
- package/dist/chunks/ScopedLogger-D-7q8uVP.js.map +1 -0
- package/dist/chunks/ScopedLogger-hS0qSkZD.js +361 -0
- package/dist/chunks/ScopedLogger-hS0qSkZD.js.map +1 -0
- package/dist/core.js +280 -307
- package/dist/exports.cjs +1 -1
- package/dist/exports.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +226 -159
- package/dist/index.js.map +1 -1
- package/dist/styling.cjs +1 -1
- package/dist/styling.js +2 -2
- package/dist/types/Logger.d.ts +11 -7
- package/dist/types/Logger.d.ts.map +1 -1
- package/dist/types/core.d.ts +122 -216
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/index.d.ts +119 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/Logger.ts +99 -58
- package/src/index.ts +32 -25
- package/dist/.tsbuildinfo +0 -1
- package/dist/Logger.d.ts +0 -708
- package/dist/Logger.d.ts.map +0 -1
- package/dist/Logger.js +0 -1124
- package/dist/ScopedLogger.d.ts +0 -318
- package/dist/ScopedLogger.d.ts.map +0 -1
- package/dist/ScopedLogger.js +0 -426
- package/dist/cli/CommandProcessor.d.ts +0 -103
- package/dist/cli/CommandProcessor.d.ts.map +0 -1
- package/dist/cli/CommandProcessor.js +0 -184
- package/dist/cli/commands/ConfigCommand.d.ts +0 -17
- package/dist/cli/commands/ConfigCommand.d.ts.map +0 -1
- package/dist/cli/commands/ConfigCommand.js +0 -88
- package/dist/cli/commands/ExportCommand.d.ts +0 -51
- package/dist/cli/commands/ExportCommand.d.ts.map +0 -1
- package/dist/cli/commands/ExportCommand.js +0 -243
- package/dist/cli/commands/HistoryCommand.d.ts +0 -50
- package/dist/cli/commands/HistoryCommand.d.ts.map +0 -1
- package/dist/cli/commands/HistoryCommand.js +0 -96
- package/dist/cli/commands/StatusCommand.d.ts +0 -33
- package/dist/cli/commands/StatusCommand.d.ts.map +0 -1
- package/dist/cli/commands/StatusCommand.js +0 -93
- package/dist/cli/commands/ThemeCommand.d.ts +0 -33
- package/dist/cli/commands/ThemeCommand.d.ts.map +0 -1
- package/dist/cli/commands/ThemeCommand.js +0 -79
- package/dist/cli/help.d.ts +0 -15
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -118
- package/dist/cli/index.d.ts +0 -15
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -46
- package/dist/constants.d.ts +0 -122
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -159
- package/dist/core.d.ts +0 -134
- package/dist/core.d.ts.map +0 -1
- package/dist/example.d.ts +0 -18
- package/dist/example.d.ts.map +0 -1
- package/dist/example.js +0 -154
- package/dist/exports-module.d.ts +0 -203
- package/dist/exports-module.d.ts.map +0 -1
- package/dist/exports-module.js +0 -260
- package/dist/handlers/AnalyticsLogHandler.d.ts +0 -11
- package/dist/handlers/AnalyticsLogHandler.d.ts.map +0 -1
- package/dist/handlers/AnalyticsLogHandler.js +0 -19
- package/dist/handlers/ExportLogHandler.d.ts +0 -103
- package/dist/handlers/ExportLogHandler.d.ts.map +0 -1
- package/dist/handlers/ExportLogHandler.js +0 -516
- package/dist/handlers/FileLogHandler.d.ts +0 -36
- package/dist/handlers/FileLogHandler.d.ts.map +0 -1
- package/dist/handlers/FileLogHandler.js +0 -156
- package/dist/handlers/RemoteLogHandler.d.ts +0 -14
- package/dist/handlers/RemoteLogHandler.d.ts.map +0 -1
- package/dist/handlers/RemoteLogHandler.js +0 -37
- package/dist/handlers/index.d.ts +0 -8
- package/dist/handlers/index.d.ts.map +0 -1
- package/dist/handlers/index.js +0 -7
- package/dist/index.d.ts +0 -157
- package/dist/index.d.ts.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -139
- package/dist/styling/LogStyleBuilder.d.ts +0 -149
- package/dist/styling/LogStyleBuilder.d.ts.map +0 -1
- package/dist/styling/LogStyleBuilder.js +0 -289
- package/dist/styling/SemanticStyles.d.ts +0 -181
- package/dist/styling/SemanticStyles.d.ts.map +0 -1
- package/dist/styling/SemanticStyles.js +0 -339
- package/dist/styling/SmartPresets.d.ts +0 -25
- package/dist/styling/SmartPresets.d.ts.map +0 -1
- package/dist/styling/SmartPresets.js +0 -276
- package/dist/styling/StyleBuilder.d.ts +0 -140
- package/dist/styling/StyleBuilder.d.ts.map +0 -1
- package/dist/styling/StyleBuilder.js +0 -280
- package/dist/styling/banners.d.ts +0 -45
- package/dist/styling/banners.d.ts.map +0 -1
- package/dist/styling/banners.js +0 -155
- package/dist/styling/index.d.ts +0 -10
- package/dist/styling/index.d.ts.map +0 -1
- package/dist/styling/index.js +0 -9
- package/dist/styling/themes.d.ts +0 -10
- package/dist/styling/themes.d.ts.map +0 -1
- package/dist/styling/themes.js +0 -231
- package/dist/styling-module.d.ts +0 -185
- package/dist/styling-module.d.ts.map +0 -1
- package/dist/styling-module.js +0 -199
- package/dist/types/core.js +0 -28
- package/dist/types/handlers.d.ts +0 -88
- package/dist/types/handlers.d.ts.map +0 -1
- package/dist/types/handlers.js +0 -4
- package/dist/types/index.js +0 -4
- package/dist/utils/environment.d.ts +0 -47
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/environment.js +0 -85
- package/dist/utils/formatting.d.ts +0 -40
- package/dist/utils/formatting.d.ts.map +0 -1
- package/dist/utils/formatting.js +0 -117
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -6
- package/dist/utils/opentui-detection.d.ts +0 -34
- package/dist/utils/opentui-detection.d.ts.map +0 -1
- package/dist/utils/opentui-detection.js +0 -116
- package/dist/utils/output.d.ts +0 -44
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/output.js +0 -150
- package/dist/utils/stackTrace.d.ts +0 -9
- package/dist/utils/stackTrace.d.ts.map +0 -1
- package/dist/utils/stackTrace.js +0 -81
- package/dist/utils/timestamps.d.ts +0 -20
- package/dist/utils/timestamps.d.ts.map +0 -1
- package/dist/utils/timestamps.js +0 -71
package/dist/exports-module.js
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Exports Module - Export and remote logging capabilities
|
|
3
|
-
* @version 0.0.1
|
|
4
|
-
*
|
|
5
|
-
* This module provides export functionality for logs including CSV, JSON, XML formats
|
|
6
|
-
* and remote logging capabilities for sending logs to external services.
|
|
7
|
-
*/
|
|
8
|
-
// Core logger and types
|
|
9
|
-
import { Logger } from './Logger.js';
|
|
10
|
-
// Export handlers
|
|
11
|
-
import { ExportLogHandler, RemoteLogHandler } from './handlers/index.js';
|
|
12
|
-
/**
|
|
13
|
-
* Logger with export and remote capabilities
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* import { ExportLogger } from '@mks2508/better-logger/exports';
|
|
18
|
-
*
|
|
19
|
-
* const logger = new ExportLogger({ bufferSize: 1000 });
|
|
20
|
-
*
|
|
21
|
-
* // Log some data
|
|
22
|
-
* logger.info('User logged in', { userId: 123 });
|
|
23
|
-
* logger.error('Failed to process', { error: 'timeout' });
|
|
24
|
-
*
|
|
25
|
-
* // Export logs
|
|
26
|
-
* const csvData = await logger.exportLogs('csv');
|
|
27
|
-
* const jsonData = await logger.exportLogs('json');
|
|
28
|
-
*
|
|
29
|
-
* // Setup remote logging
|
|
30
|
-
* logger.addRemoteHandler('https://api.myapp.com/logs', 'api-key');
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export class ExportLogger extends Logger {
|
|
34
|
-
exportLogHandler;
|
|
35
|
-
remoteHandlers = [];
|
|
36
|
-
constructor(config = {}) {
|
|
37
|
-
super(config);
|
|
38
|
-
// Initialize export handler if buffer size specified
|
|
39
|
-
if (config.bufferSize) {
|
|
40
|
-
this.exportLogHandler = new ExportLogHandler(config.bufferSize);
|
|
41
|
-
this.addHandler(this.exportLogHandler);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Export logs in specified format
|
|
46
|
-
*
|
|
47
|
-
* @param format - Export format (csv, json, xml)
|
|
48
|
-
* @param options - Export options
|
|
49
|
-
* @returns Promise resolving to exported data
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```typescript
|
|
53
|
-
* const csvData = await logger.exportLogs('csv');
|
|
54
|
-
* const jsonData = await logger.exportLogs('json', {
|
|
55
|
-
* filter: { level: 'error' },
|
|
56
|
-
* limit: 100
|
|
57
|
-
* });
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
async exportLogs(format, options) {
|
|
61
|
-
if (!this.exportLogHandler) {
|
|
62
|
-
throw new Error('Export handler not initialized. Set bufferSize in constructor.');
|
|
63
|
-
}
|
|
64
|
-
// Temporary implementation - ExportLogHandler needs these methods
|
|
65
|
-
return JSON.stringify([]);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get current log buffer
|
|
69
|
-
*
|
|
70
|
-
* @returns Array of log entries
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* const logs = logger.getLogs();
|
|
75
|
-
* console.log(`Buffered ${logs.length} log entries`);
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
getLogs() {
|
|
79
|
-
if (!this.exportLogHandler) {
|
|
80
|
-
return [];
|
|
81
|
-
}
|
|
82
|
-
// Temporary implementation - ExportLogHandler needs these methods
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Clear the log buffer
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```typescript
|
|
90
|
-
* logger.clearLogs();
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
clearLogs() {
|
|
94
|
-
if (this.exportLogHandler) {
|
|
95
|
-
// Temporary implementation - ExportLogHandler needs these methods
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Get log statistics
|
|
100
|
-
*
|
|
101
|
-
* @returns Statistics object with counts by level
|
|
102
|
-
*
|
|
103
|
-
* @example
|
|
104
|
-
* ```typescript
|
|
105
|
-
* const stats = logger.getLogStats();
|
|
106
|
-
* console.log(`Errors: ${stats.error}, Warnings: ${stats.warn}`);
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
getLogStats() {
|
|
110
|
-
if (!this.exportLogHandler) {
|
|
111
|
-
return {};
|
|
112
|
-
}
|
|
113
|
-
// Temporary implementation - ExportLogHandler needs these methods
|
|
114
|
-
return {};
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Add remote logging handler
|
|
118
|
-
*
|
|
119
|
-
* @param endpoint - Remote endpoint URL
|
|
120
|
-
* @param apiKey - Optional API key for authentication
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* ```typescript
|
|
124
|
-
* logger.addRemoteHandler('https://logs.myservice.com/api', 'secret-key');
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
addRemoteHandler(endpoint, apiKey) {
|
|
128
|
-
const remoteHandler = new RemoteLogHandler(endpoint, apiKey);
|
|
129
|
-
this.remoteHandlers.push(remoteHandler);
|
|
130
|
-
this.addHandler(remoteHandler);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Remove all remote handlers
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```typescript
|
|
137
|
-
* logger.clearRemoteHandlers();
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
clearRemoteHandlers() {
|
|
141
|
-
// Remove from handlers array
|
|
142
|
-
const allHandlers = this.getHandlers();
|
|
143
|
-
this.remoteHandlers.forEach(remoteHandler => {
|
|
144
|
-
const index = allHandlers.indexOf(remoteHandler);
|
|
145
|
-
if (index > -1) {
|
|
146
|
-
allHandlers.splice(index, 1);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
this.remoteHandlers = [];
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Flush all remote handlers (force send pending logs)
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```typescript
|
|
156
|
-
* await logger.flushRemoteHandlers();
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
async flushRemoteHandlers() {
|
|
160
|
-
const flushPromises = this.remoteHandlers.map(handler => Promise.resolve() // RemoteLogHandler needs flush method
|
|
161
|
-
);
|
|
162
|
-
await Promise.all(flushPromises);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
// Create singleton instance with export capabilities
|
|
166
|
-
const exportLogger = new ExportLogger({ bufferSize: 1000 });
|
|
167
|
-
/**
|
|
168
|
-
* Export management utilities
|
|
169
|
-
*/
|
|
170
|
-
export const exportUtils = {
|
|
171
|
-
/**
|
|
172
|
-
* Export current logs as CSV
|
|
173
|
-
*/
|
|
174
|
-
async exportCSV(options) {
|
|
175
|
-
return await exportLogger.exportLogs('csv', options);
|
|
176
|
-
},
|
|
177
|
-
/**
|
|
178
|
-
* Export current logs as JSON
|
|
179
|
-
*/
|
|
180
|
-
async exportJSON(options) {
|
|
181
|
-
return await exportLogger.exportLogs('json', options);
|
|
182
|
-
},
|
|
183
|
-
/**
|
|
184
|
-
* Export current logs as XML
|
|
185
|
-
*/
|
|
186
|
-
async exportXML(options) {
|
|
187
|
-
return await exportLogger.exportLogs('xml', options);
|
|
188
|
-
},
|
|
189
|
-
/**
|
|
190
|
-
* Get log statistics
|
|
191
|
-
*/
|
|
192
|
-
getStats() {
|
|
193
|
-
return exportLogger.getLogStats();
|
|
194
|
-
},
|
|
195
|
-
/**
|
|
196
|
-
* Clear all logs
|
|
197
|
-
*/
|
|
198
|
-
clear() {
|
|
199
|
-
exportLogger.clearLogs();
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* Remote logging utilities
|
|
204
|
-
*/
|
|
205
|
-
export const remoteUtils = {
|
|
206
|
-
/**
|
|
207
|
-
* Add remote logging endpoint
|
|
208
|
-
*/
|
|
209
|
-
addEndpoint(url, apiKey) {
|
|
210
|
-
exportLogger.addRemoteHandler(url, apiKey);
|
|
211
|
-
},
|
|
212
|
-
/**
|
|
213
|
-
* Clear all remote endpoints
|
|
214
|
-
*/
|
|
215
|
-
clearEndpoints() {
|
|
216
|
-
exportLogger.clearRemoteHandlers();
|
|
217
|
-
},
|
|
218
|
-
/**
|
|
219
|
-
* Flush all remote logs
|
|
220
|
-
*/
|
|
221
|
-
async flush() {
|
|
222
|
-
await exportLogger.flushRemoteHandlers();
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* Export individual logging methods with export capabilities
|
|
227
|
-
*/
|
|
228
|
-
export const debug = (...args) => exportLogger.debug(...args);
|
|
229
|
-
export const info = (...args) => exportLogger.info(...args);
|
|
230
|
-
export const warn = (...args) => exportLogger.warn(...args);
|
|
231
|
-
export const error = (...args) => exportLogger.error(...args);
|
|
232
|
-
export const success = (...args) => exportLogger.success(...args);
|
|
233
|
-
export const critical = (...args) => exportLogger.critical(...args);
|
|
234
|
-
export const trace = (...args) => exportLogger.trace(...args);
|
|
235
|
-
export const table = (data, columns) => exportLogger.table(data, columns);
|
|
236
|
-
export const group = (label, collapsed) => exportLogger.group(label, collapsed);
|
|
237
|
-
export const groupEnd = () => exportLogger.groupEnd();
|
|
238
|
-
export const time = (label) => exportLogger.time(label);
|
|
239
|
-
export const timeEnd = (label) => exportLogger.timeEnd(label);
|
|
240
|
-
export const setGlobalPrefix = (prefix) => exportLogger.setGlobalPrefix(prefix);
|
|
241
|
-
export const scope = (prefix) => exportLogger.scope(prefix);
|
|
242
|
-
export const setVerbosity = (level) => exportLogger.setVerbosity(level);
|
|
243
|
-
export const addHandler = (handler) => exportLogger.addHandler(handler);
|
|
244
|
-
/**
|
|
245
|
-
* Export functionality
|
|
246
|
-
*/
|
|
247
|
-
export const exportLogs = async (format, options) => await exportLogger.exportLogs(format, options);
|
|
248
|
-
export const getLogs = () => exportLogger.getLogs();
|
|
249
|
-
export const clearLogs = () => exportLogger.clearLogs();
|
|
250
|
-
export const getLogStats = () => exportLogger.getLogStats();
|
|
251
|
-
/**
|
|
252
|
-
* Remote logging functionality
|
|
253
|
-
*/
|
|
254
|
-
export const addRemoteHandler = (endpoint, apiKey) => exportLogger.addRemoteHandler(endpoint, apiKey);
|
|
255
|
-
export const clearRemoteHandlers = () => exportLogger.clearRemoteHandlers();
|
|
256
|
-
export const flushRemoteHandlers = async () => await exportLogger.flushRemoteHandlers();
|
|
257
|
-
// Export the singleton as default
|
|
258
|
-
export default exportLogger;
|
|
259
|
-
// Re-export handlers
|
|
260
|
-
export { ExportLogHandler, RemoteLogHandler } from './handlers/index.js';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Analytics log handler for Advanced Logger
|
|
3
|
-
*/
|
|
4
|
-
import type { ILogHandler, LogLevel, LogMetadata } from '../types/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Example custom handler for analytics demonstration
|
|
7
|
-
*/
|
|
8
|
-
export declare class AnalyticsLogHandler implements ILogHandler {
|
|
9
|
-
handle(level: LogLevel, message: string, _args: any[], metadata: LogMetadata): void;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=AnalyticsLogHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsLogHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/AnalyticsLogHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5E;;GAEG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IACnD,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI;CAWtF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Analytics log handler for Advanced Logger
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Example custom handler for analytics demonstration
|
|
6
|
-
*/
|
|
7
|
-
export class AnalyticsLogHandler {
|
|
8
|
-
handle(level, message, _args, metadata) {
|
|
9
|
-
// In a real implementation, this could send analytics data
|
|
10
|
-
if (level === 'error' || level === 'critical') {
|
|
11
|
-
// Track errors for analytics
|
|
12
|
-
console.debug('Analytics: Error tracked', {
|
|
13
|
-
level,
|
|
14
|
-
message,
|
|
15
|
-
timestamp: metadata.timestamp
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Export and clipboard log handler for Advanced Logger
|
|
3
|
-
*/
|
|
4
|
-
import type { ILogHandler, LogLevel, LogMetadata, LogEntry, ExportFilters, ExportOptions, ExportResult, BufferStats, ExportFormat } from '../types/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Export log handler with circular buffer and multiple export formats
|
|
7
|
-
*/
|
|
8
|
-
export declare class ExportLogHandler implements ILogHandler {
|
|
9
|
-
private buffer;
|
|
10
|
-
private maxSize;
|
|
11
|
-
private groupDepth;
|
|
12
|
-
private currentGroup?;
|
|
13
|
-
constructor(maxSize?: number);
|
|
14
|
-
/**
|
|
15
|
-
* Handle incoming log and store in buffer
|
|
16
|
-
*/
|
|
17
|
-
handle(level: LogLevel, message: string, args: any[], metadata: LogMetadata): void;
|
|
18
|
-
/**
|
|
19
|
-
* Set group tracking for nested logs
|
|
20
|
-
*/
|
|
21
|
-
setGroupInfo(depth: number, groupName?: string): void;
|
|
22
|
-
/**
|
|
23
|
-
* Get buffer statistics
|
|
24
|
-
*/
|
|
25
|
-
getBufferStats(): BufferStats;
|
|
26
|
-
/**
|
|
27
|
-
* Clear the buffer
|
|
28
|
-
*/
|
|
29
|
-
clearBuffer(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Set buffer size (with limits)
|
|
32
|
-
*/
|
|
33
|
-
setBufferSize(size: number): void;
|
|
34
|
-
/**
|
|
35
|
-
* Filter logs based on criteria
|
|
36
|
-
*/
|
|
37
|
-
private filterLogs;
|
|
38
|
-
/**
|
|
39
|
-
* Export logs in JSON format
|
|
40
|
-
*/
|
|
41
|
-
private exportJSON;
|
|
42
|
-
/**
|
|
43
|
-
* Export logs in CSV format
|
|
44
|
-
*/
|
|
45
|
-
private exportCSV;
|
|
46
|
-
/**
|
|
47
|
-
* Export logs in Markdown format
|
|
48
|
-
*/
|
|
49
|
-
private exportMarkdown;
|
|
50
|
-
/**
|
|
51
|
-
* Export logs in plain text format
|
|
52
|
-
*/
|
|
53
|
-
private exportPlain;
|
|
54
|
-
/**
|
|
55
|
-
* Export logs in HTML format
|
|
56
|
-
*/
|
|
57
|
-
private exportHTML;
|
|
58
|
-
/**
|
|
59
|
-
* Get emoji for log level
|
|
60
|
-
*/
|
|
61
|
-
private getLevelEmoji;
|
|
62
|
-
/**
|
|
63
|
-
* Main export function
|
|
64
|
-
*/
|
|
65
|
-
export(format: ExportFormat, filters?: ExportFilters, options?: ExportOptions): ExportResult;
|
|
66
|
-
/**
|
|
67
|
-
* Copy to clipboard with fallback
|
|
68
|
-
*/
|
|
69
|
-
copyToClipboard(format: ExportFormat, filters?: ExportFilters, options?: ExportOptions): Promise<boolean>;
|
|
70
|
-
/**
|
|
71
|
-
* Get all logs (for debugging)
|
|
72
|
-
*/
|
|
73
|
-
getAllLogs(): LogEntry[];
|
|
74
|
-
/**
|
|
75
|
-
* Save export to file with download prompt
|
|
76
|
-
*/
|
|
77
|
-
saveToFile(format: ExportFormat, filters?: ExportFilters, options?: ExportOptions): Promise<boolean>;
|
|
78
|
-
/**
|
|
79
|
-
* Get MIME type for format
|
|
80
|
-
*/
|
|
81
|
-
private getMimeType;
|
|
82
|
-
/**
|
|
83
|
-
* Generate filename with timestamp
|
|
84
|
-
*/
|
|
85
|
-
private generateFilename;
|
|
86
|
-
/**
|
|
87
|
-
* Stream logs to external endpoint
|
|
88
|
-
*/
|
|
89
|
-
streamToEndpoint(endpoint: string, filters?: ExportFilters, options?: {
|
|
90
|
-
apiKey?: string;
|
|
91
|
-
batchSize?: number;
|
|
92
|
-
format?: ExportFormat;
|
|
93
|
-
}): Promise<boolean>;
|
|
94
|
-
/**
|
|
95
|
-
* Create export with metadata enrichment
|
|
96
|
-
*/
|
|
97
|
-
exportWithMetadata(format: ExportFormat, filters?: ExportFilters, options?: ExportOptions): ExportResult;
|
|
98
|
-
/**
|
|
99
|
-
* Estimate memory usage of buffer
|
|
100
|
-
*/
|
|
101
|
-
private estimateMemoryUsage;
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=ExportLogHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExportLogHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/ExportLogHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACR,WAAW,EACX,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACf,MAAM,mBAAmB,CAAC;AAI3B;;GAEG;AACH,qBA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