A destination that receives log calls in addition to the console, such as PostHog Logs. isEnabled is checked first so a disabled level costs no more than one function call.
isEnabled
emit
const sink: RemoteLogSink = { isEnabled: (level) => level === 'error', emit: (record) => queue.push(record),};Logger.setRemoteSink(sink); Copy
const sink: RemoteLogSink = { isEnabled: (level) => level === 'error', emit: (record) => queue.push(record),};Logger.setRemoteSink(sink);
export interface RemoteLogSink { isEnabled(level: RemoteLogLevel): boolean; emit(record: RemoteLogRecord): void;} Copy
export interface RemoteLogSink { isEnabled(level: RemoteLogLevel): boolean; emit(record: RemoteLogRecord): void;}
A destination that receives log calls in addition to the console, such as PostHog Logs.
isEnabledis checked first so a disabled level costs no more than one function call.isEnabled- Whether records at this level are currently wanted.emit- Receives a record. Must not throw.Example
Source