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

fix: Set console log level to the application one when writing to file #3380

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

mstoykov
Copy link
Contributor

@mstoykov mstoykov commented Oct 11, 2023

This fixes console.debug() messages printing with --console-output file.txt and -v given to k6 cli.

This already works when it isn't redirected to a file as it goes through the application wide logger.

This already works when it isn't redirected to a file as it goes through
the application wide logger.
@mstoykov mstoykov added the bug label Oct 11, 2023
@mstoykov mstoykov added this to the v0.48.0 milestone Oct 11, 2023
@github-actions github-actions bot requested review from codebien and oleiade October 11, 2023 08:26
@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (6e2c8e8) 72.94% compared to head (3457a25) 72.80%.

❗ Current head 3457a25 differs from pull request most recent head 15b9e77. Consider uploading reports for the commit 15b9e77 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3380      +/-   ##
==========================================
- Coverage   72.94%   72.80%   -0.15%     
==========================================
  Files         261      259       -2     
  Lines       20018    20019       +1     
==========================================
- Hits        14603    14575      -28     
- Misses       4488     4509      +21     
- Partials      927      935       +8     
Flag Coverage Δ
ubuntu ?
windows 72.80% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
js/console.go 94.28% <100.00%> (+0.16%) ⬆️
js/runner.go 84.90% <100.00%> (+0.06%) ⬆️

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@codebien codebien left a comment

Choose a reason for hiding this comment

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

IMHO, we should address #2968 and apply the fix at the same time. I can do an attempt as this is marked as v0.48.0.

@mstoykov
Copy link
Contributor Author

I only made this fix as investigating the issue directly pointed out a 3 lines fix.

The other issue has multiple things in it and even just the os.OpenFile one still seems like a thing that will take quite a big refactor not to speak adding and e2e test will be a lot more work./

So I still prefer to fix this now and leave the other issue for when we have more time or more of the problems have been resolved for other reasons.

@mstoykov mstoykov merged commit c949fd8 into master Oct 12, 2023
@mstoykov mstoykov deleted the fixConsoleLevelWhenRedirectingToFile branch October 12, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants