Reduce logging noise produced by the browser module as a default #1553
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theK6_BROWSER_LOG
env variable to set it todebug
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 fromInfo
toDebug
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 fromInfo
toDebug
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 theonConsoleAPICalled
method by removing the switch statement for different log levels, defaulting toDebug
for all console API calls.common/frame_session.go
: Simplified theonLogEntryAdded
method by removing the switch statement for different log levels, defaulting toDebug
for all log entries.## What?Checklist
Related PR(s)/Issue(s)
closes #1483