Sinks are responsible for persisting trace events to various destinations like files,
databases, or remote services. They serve as pluggable backends for the tracing system.
Remarks
Implementation guidelines:
Make implementations resilient and non-throwing by default
Favor local-first behavior for offline/development workflows
Handle errors gracefully without disrupting the application
Consider implementing BufferedSink for better performance
Example
// A simple sink that logs events to the console. classConsoleSinkimplementsSink { write(sessionId: string, e: TracerEvent): void { const { type, level } = e; console.log(`[${sessionId}] ${level} - ${type}`); } }
A destination for AccordKit trace events.
Sinks are responsible for persisting trace events to various destinations like files, databases, or remote services. They serve as pluggable backends for the tracing system.
Remarks
Implementation guidelines:
Example