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

registry: configureLogging() simplify logic a bit #3772

Merged

Conversation

thaJeztah
Copy link
Member

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2022

Codecov Report

Base: 57.06% // Head: 56.92% // Decreases project coverage by -0.13% ⚠️

Coverage data is based on head (b73c038) compared to base (c47a966).
Patch coverage: 70.11% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3772      +/-   ##
==========================================
- Coverage   57.06%   56.92%   -0.14%     
==========================================
  Files         105      105              
  Lines       10806    10797       -9     
==========================================
- Hits         6166     6146      -20     
- Misses       3952     3962      +10     
- Partials      688      689       +1     
Impacted Files Coverage Δ
configuration/configuration.go 64.38% <ø> (ø)
context/trace.go 93.47% <ø> (ø)
contrib/token-server/main.go 0.00% <0.00%> (ø)
manifest/ocischema/manifest.go 74.19% <ø> (ø)
manifest/schema1/manifest.go 33.82% <ø> (ø)
manifest/schema1/reference_builder.go 94.00% <ø> (ø)
manifest/schema2/manifest.go 80.00% <ø> (-0.40%) ⬇️
reference/reference.go 79.08% <ø> (ø)
registry/api/errcode/register.go 30.76% <ø> (ø)
registry/api/v2/descriptors.go 100.00% <ø> (ø)
... and 36 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines 355 to 357
// Set the config to the default ("text") formatter in case none was
// specified.
config.Log.Formatter = "text"
Copy link
Member Author

Choose a reason for hiding this comment

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

oh! Wait, I had my wires crossed when I wrote this. I thought the original code (before my change) updated the config struct, so I added this line. I'm not a fan of updating the config itself, so let me move this back to the start (and use a local variable).

Comment on lines -374 to -375
if config.Log.Formatter != "" {
logrus.Debugf("using %q logging formatter", config.Log.Formatter)
Copy link
Member Author

Choose a reason for hiding this comment

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

.. because I think the "bug" was actually here; this block should've used the local variable (formatter), not the config.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

updated with the changes I mentioned above; PTAL 👍

@deleteriousEffect deleteriousEffect merged commit e9a25da into distribution:main Nov 8, 2022
@thaJeztah thaJeztah deleted the registry_logging_simplify branch November 8, 2022 09:26
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.

None yet

4 participants