Skip to content

Add option to pass custom logger to rrweb record #831

@wbobeirne

Description

@wbobeirne

I use a custom logger in my frontend to send logs server side for analysis. Unfortunately I'm unable to record any rrweb debug logging since it uses a console.log with no way to override it:

private debug(...args: Parameters<typeof console.log>) {
if (!this.config.showDebug) {
return;
}
// tslint:disable-next-line: no-console
console.log(REPLAY_CONSOLE_PREFIX, ...args);
}
}

It'd be nice if there was an option for passing a custom function that would be called instead. Ideally the call happens before the showDebug check so that we can implement custom logic for showDebug instead of having to call setConfig to update it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has PRalready has pull request for it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions