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

Add an option to suppress browser logs while keeping console.log output #1560

Closed
nexus9111 opened this issue Dec 12, 2024 · 2 comments
Closed
Labels
feature A new feature

Comments

@nexus9111
Copy link

Feature Description

It would be great to have an option in k6browser that allows running a script using the standard k6 run command but with the ability to suppress browser-related logs (e.g., logs from the browser itself or system-level debugging) while still preserving the output of console.log statements from the script.

Use Case:
In many scenarios, users want to focus on the custom logs added in their scripts (via console.log) for debugging or analysis. However, the current behavior includes browser logs which can make it difficult to sift through the information.

Proposed Solution:
Introduce a command-line option like --silent-browser-logs or --filter-logs to filter out browser-related logs but keep console.log outputs intact.

Thank you for considering this feature!

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response

@nexus9111 nexus9111 added the feature A new feature label Dec 12, 2024
@ankur22
Copy link
Collaborator

ankur22 commented Dec 12, 2024

Hi @nexus9111,

We've recently merged in a change which by default completely suppresses the logs coming from chromium/chrome and the logs that are logged by the website under test. Here's the PR: #1553. This will make into the next release of k6 (v0.56.0). This means that the logs that are logged will either be:

  1. Internal errors;
  2. User errors -- trying to highlight incorrect usage of APIs;
  3. console.logs from the test script.

Hope this will satisfy your requirements.

@nexus9111
Copy link
Author

Hi @ankur22

Awesome, thank you !

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

No branches or pull requests

2 participants