Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce logging noise produced by the browser module as a default #1553

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Nov 29, 2024

What

This pull request is aiming at bringing improvements to how the browser module handles logging. Generally we have made most of the relevant logging of the browser use the debug level, assuming users still can set the K6_BROWSER_LOG env variable to set it to debug and keep seeing all the logs.

We believe more could be done on improvements to the logging: such as having a way to subscribe to the various log sources the browser is exposed to such as chromium, or improve the error reporting to not follow the stacktrace-like format it currently follows.

However we suggest to move those designs/problems to separate issues. Furthermore, we suggest to mark #1483 as closed when this PR is merged, in favor of new more focused issues on the above.

👇 copilot generated

This pull request includes changes to the logging levels and the handling of console API calls in the common package. The most important changes include modifying the logging levels from Info to Debug for certain messages and simplifying the handling of console API calls and log entries.

Changes to logging levels:

  • common/remote_object.go: Changed logging level from Info to Debug for messages indicating that an object or array is too large and will be parsed partially. [1] [2]

Simplification of console API calls and log entries:

  • common/frame_session.go: Simplified the onConsoleAPICalled method by removing the switch statement for different log levels, defaulting to Debug for all console API calls.
  • common/frame_session.go: Simplified the onLogEntryAdded method by removing the switch statement for different log levels, defaulting to Debug for all log entries.## What?

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

closes #1483

@oleiade oleiade added the enhancement New feature or request label Nov 29, 2024
@oleiade oleiade requested a review from a team as a code owner November 29, 2024 13:04
@oleiade oleiade requested review from olegbespalov, joanlopez, inancgumus and ankur22 and removed request for a team November 29, 2024 13:04
@oleiade
Copy link
Member Author

oleiade commented Nov 29, 2024

For your attention @roobre (if relevant), this PR will suppress most of the log lines produced by the browser as a default, as per #1483. To bring them back the environment variable K6_BROWSER_LOG should be set to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User friendly error messages
1 participant