fix: log actual providers cache path instead of function reference#3283
Open
Ajithkumar003-dev wants to merge 1 commit into
Open
fix: log actual providers cache path instead of function reference#3283Ajithkumar003-dev wants to merge 1 commit into
Ajithkumar003-dev wants to merge 1 commit into
Conversation
In UpdateProviders, the slog.Info call was passing cachePathFor (the
function itself) as the "to" log attribute instead of calling it with
"providers" to get the resolved path string. This caused the log line
to record the function pointer address rather than the cache file path,
making it impossible to tell from logs where providers were actually
written.
UpdateHyper (line 121) correctly calls cachePathFor("hyper"); this
commit applies the same pattern to UpdateProviders.
Co-Authored-By: Ajithkumar003-dev <Ajithkumar003-dev@users.noreply.github.com>
Contributor
|
Thank you for your submission. We really appreciate it! Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request comment same as the below format. I have read the Contributor License Agreement (CLA) and hereby sign the CLA. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
In
UpdateProviders, theslog.Infocall was passingcachePathFor(the function itself) as the"to"log attribute instead of invoking it with"providers"to get the resolved path string.`go
// Before
slog.Info("Providers updated successfully", "count", len(providers), "from", pathOrURL, "to", cachePathFor)
// After
slog.Info("Providers updated successfully", "count", len(providers), "from", pathOrURL, "to", cachePathFor("providers"))
`
Why it matters
This caused the structured log line to record the function pointer address (e.g.
0x6c3f40) as thetofield instead of the actual file path, making it impossible to tell from logs where providers were written to disk.Compare with
UpdateHyper33 lines below, which already callscachePathFor("hyper")correctly. This commit applies the same pattern toUpdateProviders.Testing
Run
crush update-providersand check that the log line now shows the full cache file path under thetokey.