Files
ccs/src/services/logging/log-buffer.ts
T
Tam Nhu Tran 6c799b2e58 feat(logging): unify CCS runtime logs and dashboard viewer
- add a shared structured logging service with bounded retention

- expose native /api/logs endpoints and the dashboard /logs route

- wire focused runtime emitters, cleanup support, and feature tests

Refs #926
2026-04-08 15:57:15 -04:00

19 lines
474 B
TypeScript

import type { LogEntry } from './log-types';
let recentEntries: LogEntry[] = [];
export function pushRecentLogEntry(entry: LogEntry, maxEntries: number): void {
recentEntries.push(entry);
if (recentEntries.length > maxEntries) {
recentEntries = recentEntries.slice(recentEntries.length - maxEntries);
}
}
export function getRecentLogEntries(): LogEntry[] {
return [...recentEntries];
}
export function clearRecentLogEntries(): void {
recentEntries = [];
}