UNPKG

@bugspotter/sdk

Version:

Professional bug reporting SDK with screenshots, session replay, and automatic error capture for web applications

30 lines (29 loc) 871 B
import { BaseCapture, type CaptureOptions } from './base-capture'; type ConsoleLevel = 'log' | 'warn' | 'error' | 'info' | 'debug'; export interface ConsoleCaptureOptions extends CaptureOptions { maxLogs?: number; captureStackTrace?: boolean; levels?: readonly ConsoleLevel[]; } export declare class ConsoleCapture extends BaseCapture<LogEntry[], ConsoleCaptureOptions> { private buffer; private captureStackTrace; private originalMethods; constructor(options?: ConsoleCaptureOptions); capture(): LogEntry[]; private formatMessage; private createLogEntry; private captureStack; private addLog; private interceptConsole; getLogs(): LogEntry[]; clear(): void; destroy(): void; } export interface LogEntry { level: ConsoleLevel; message: string; timestamp: number; stack?: string; } export {};