Skip to content

feat: Output JSON logs to stdout #7

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

Merged
merged 1 commit into from
Mar 20, 2025
Merged

feat: Output JSON logs to stdout #7

merged 1 commit into from
Mar 20, 2025

Conversation

sirewix
Copy link
Contributor

@sirewix sirewix commented Mar 18, 2025

@sirewix sirewix requested a review from a team as a code owner March 18, 2025 15:10
@sirewix sirewix marked this pull request as draft March 18, 2025 15:47
@sirewix sirewix force-pushed the sirewix/json-logs branch from 420da4a to 1ebf726 Compare March 19, 2025 16:14
@sirewix sirewix changed the title refactor!: Output JSON logs to stdout refactor: Output JSON logs to stdout Mar 19, 2025
@sirewix sirewix changed the title refactor: Output JSON logs to stdout feat: Output JSON logs to stdout Mar 19, 2025
@sirewix sirewix marked this pull request as ready for review March 19, 2025 16:19
@sirewix sirewix self-assigned this Mar 19, 2025
@emgrav
Copy link
Member

emgrav commented Mar 19, 2025

maybe a bit late to make this suggestion, but maybe it makes more sense to just allow users to choose the formatter rather than just a json boolean? We might want to use the extra pretty print in tests fx

just a thought, don't let it block merging if you disagree

@sirewix
Copy link
Contributor Author

sirewix commented Mar 19, 2025

@emgrav
It could be a nice feature, but I think default json vs not json should be enough for now. And it's not a breaking change, I explicitly set default to be false.

As for the tests, I don't think we should init the whole otel stack in there, it spams extra "cannot export something something" errors. We use traced_test in some crates, seem to work ok and is pretty easy to bootstrap

@sirewix sirewix merged commit 1ebf726 into main Mar 20, 2025
2 checks passed
@sirewix sirewix deleted the sirewix/json-logs branch March 20, 2025 12:42
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.70%. Comparing base (53dec92) to head (1ebf726).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/lib.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
+ Coverage   80.50%   80.70%   +0.19%     
==========================================
  Files           4        4              
  Lines         277      285       +8     
==========================================
+ Hits          223      230       +7     
- Misses         54       55       +1     
Files with missing lines Coverage Δ
src/config.rs 100.00% <100.00%> (ø)
src/lib.rs 86.63% <85.71%> (-0.27%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53dec92...1ebf726. Read the comment docs.

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.

3 participants