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

chore: Convert to log/slog #519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

chore: Convert to log/slog #519

wants to merge 1 commit into from

Conversation

bhavanki
Copy link
Contributor

@bhavanki bhavanki commented Jun 17, 2024

The small amount of verbose logging in the exec command has been
converted to debug logging under log/slog.

@bhavanki bhavanki requested a review from a team as a code owner June 17, 2024 16:20
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 11.53846% with 23 lines in your changes missing coverage. Please review.

Project coverage is 36.33%. Comparing base (c02ccfc) to head (d79ef21).
Report is 1 commits behind head on master.

Current head d79ef21 differs from pull request most recent head edec220

Please upload reports for the commit edec220 to get more accurate results.

Files with missing lines Patch % Lines
cmd/root.go 13.63% 19 Missing ⚠️
cmd/exec.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #519      +/-   ##
==========================================
- Coverage   36.44%   36.33%   -0.11%     
==========================================
  Files          29       29              
  Lines        3257     3275      +18     
==========================================
+ Hits         1187     1190       +3     
- Misses       1983     1998      +15     
  Partials       87       87              

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

@bhavanki
Copy link
Contributor Author

slog was introduced in Go 1.21, so this cannot be integrated yet since chamber still supports go 1.20. I'll leave this PR inactive until the 1.23 release, which is expected in August (about 2 months from now).

Sabrina0614
Sabrina0614 previously approved these changes Nov 5, 2024
cmd/root.go Outdated Show resolved Hide resolved
The small amount of verbose logging in the exec command has been
converted to debug logging under log/slog.
Copy link
Contributor

@alecjacobs5401 alecjacobs5401 left a comment

Choose a reason for hiding this comment

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

moreso an open question, but thanks for doing this!

if verbose {
fmt.Fprintf(os.Stdout, "info: With environment %s\n", strings.Join(env, ","))
}
slog.Debug(fmt.Sprintf("info: With environment %s\n", strings.Join(env, ",")))
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any world where this is considered a breaking change? It looks like the comment in the help output for verbose before was wrong since partially we output to STDERR (only this line apparently was to STDOUT)

Do we need to keep that consistency for any reason?

@kevinburkesegment
Copy link
Contributor

@bhavanki Let's merge this

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

Successfully merging this pull request may close these issues.

4 participants