MCPcopy Create free account
hub / github.com/Roy3838/Observer / log

Method log

app/src/utils/logging.ts:44–71  ·  view source on GitHub ↗

* Add a new log entry

(
    level: LogLevel,
    source: string,
    message: string,
    details?: any
  )

Source from the content-addressed store, hash-verified

42 * Add a new log entry
43 */
44 public log(
45 level: LogLevel,
46 source: string,
47 message: string,
48 details?: any
49 ): LogEntry {
50 const entry: LogEntry = {
51 id: `log-${this.nextLogId++}`,
52 timestamp: new Date(),
53 level,
54 source,
55 message,
56 details
57 };
58
59 // Add to log array
60 this.logs.push(entry);
61
62 // Trim logs if we exceed max size
63 if (this.logs.length > this.maxLogEntries) {
64 this.logs = this.logs.slice(-this.maxLogEntries);
65 }
66
67 // Notify all listeners
68 this.notifyListeners(entry);
69
70 return entry;
71 }
72
73 /**
74 * Convenience method for debug logs

Callers 15

debugMethod · 0.95
infoMethod · 0.95
warnMethod · 0.95
errorMethod · 0.95
fetchQuotaInfoFunction · 0.45
AppHeaderFunction · 0.45
formatBytesFunction · 0.45
formatBytesFunction · 0.45
formatBytesFunction · 0.45
formatBytesFunction · 0.45
handleIterationStartFunction · 0.45
formatBytesFunction · 0.45

Calls 2

notifyListenersMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected