Function: onLog()
onLog(
listener): () =>void
Defined in: utils/logger.ts:248
Register a callback that receives every log message (at or above the active
LOG_LEVEL). The forwarded LogEntry is sanitized, so secrets are
never leaked to a remote endpoint.
Parameters
listener
Returns
An unsubscribe function that removes the listener.
():
void
Returns
void
Example
import { onLog } from 'manim-web';
const stop = onLog((entry) =>
fetch('/__log', { method: 'POST', body: JSON.stringify(entry) }),
);
// ...later
stop();