Skip to content

Conversation

@Dobrunia
Copy link
Member

What's Changed?

  • Improved interception of console.log, console.warn, console.error, console.info, and console.debug.
  • Added stack trace capture for console logs, including file and line number.
  • Fixed serialization of non-string log arguments.
  • Introduced initConsoleCatcher() to prevent duplicate hooks.

// eslint-disable-next-line @typescript-eslint/no-explicit-any
args: any;
}
import type { ConsoleLogEvent } from '@hawk.so/types/build/src/base/event/addons/javascript';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import type { ConsoleLogEvent } from '@hawk.so/types/build/src/base/event/addons/javascript';
import type { ConsoleLogEvent } from '@hawk.so/types';

};
});

window.addEventListener('error', function (event) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think how we can reuse existing catcher errors

import type { ConsoleLogEvent } from '@hawk.so/types/build/src/base/event/addons/javascript';

const MAX_LOGS = 20;
const consoleOutput: ConsoleLogEvent[] = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use scoped variable instead of global?

Copy link
Contributor

@e11sy e11sy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix bug in repetitions
image
and bump package version

@Dobrunia Dobrunia merged commit 5c549bf into master Mar 16, 2025
2 checks passed
@Dobrunia Dobrunia deleted the feat/console-catcher branch March 16, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants