MCPcopy
hub / github.com/continuedev/continue / PersistentLogger

Class PersistentLogger

manual-testing-sandbox/next-edit/next-edit-8-4-sol.ts:63–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61
62// Logger decorator to add persistent storage
63class PersistentLogger implements Logger {
64 constructor(
65 private baseLogger: Logger,
66 private storageService: StorageService,
67 ) {}
68
69 log(message: string, level: LogLevel = "info"): void {
70 // First use the base logger
71 this.baseLogger.log(message, level);
72
73 // Then persist the log
74 const timestamp = new Date().toISOString();
75 try {
76 const logs = JSON.parse(
77 this.storageService.getItem("system_logs") || "[]",
78 );
79 logs.push({ timestamp, level, message });
80 this.storageService.setItem("system_logs", JSON.stringify(logs));
81 } catch (e) {
82 this.baseLogger.log("Failed to persist log", "error");
83 }
84 }
85}
86
87// Notification service - Single Responsibility
88class NotificationService {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected