addLogEntry function exported ✓ 100.0%

Last updated: 2026-03-01T23:25:47.125Z

Metrics

LOC: 10 Complexity: 2 Params: 1 Coverage: 100.0% (6/6 lines, 1049x executed)

Signature

addLogEntry(entry: LogEntry): : void

Summary

Adds a log entry to the store. Synchronous — queues an async flush to chrome.storage.session.

Source Code

export function addLogEntry(entry: LogEntry): void {
  localEntries.push(entry);
  if (localEntries.length > maxEntries) {
    localEntries = localEntries.slice(-maxEntries);
  }

  pendingEntries.push(entry);
  notifyListeners();
  scheduleFlush();
}

Dependencies (Outgoing)

graph LR addLogEntry["addLogEntry"] notifyListeners["notifyListeners"] scheduleFlush["scheduleFlush"] addLogEntry -->|calls| notifyListeners addLogEntry -->|calls| scheduleFlush style addLogEntry fill:#dbeafe,stroke:#2563eb,stroke-width:2px click addLogEntry "b5eb9ecc61a3eb82.html" click notifyListeners "907bc8a226709b64.html" click scheduleFlush "142b73cec109660e.html"
TargetType
notifyListeners calls
scheduleFlush calls

Impact (Incoming)

graph LR addLogEntry["addLogEntry"] LogLevel["LogLevel"] flushBuffer["flushBuffer"] emit["emit"] logAuditFill["logAuditFill"] LogLevel -->|uses| addLogEntry flushBuffer -->|calls| addLogEntry emit -->|calls| addLogEntry logAuditFill -->|calls| addLogEntry style addLogEntry fill:#dbeafe,stroke:#2563eb,stroke-width:2px click addLogEntry "b5eb9ecc61a3eb82.html" click LogLevel "c16627126b9be48e.html" click flushBuffer "a9a9c3e65488e23e.html" click emit "131b8d3f5dc1f207.html" click logAuditFill "221e9f6c8e5f6850.html"
SourceType
LogLevel uses
flushBuffer calls
emit calls
logAuditFill calls