nuts-foundation / nuts-foundation/nuts-node
Entry.Level compared against DebugLevel is always false, so gated debug diagnostics never fire
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 28
- Forks
- 23
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 76
Description
The module log.Logger() helpers return a *logrus.Entry created with logrus.StandardLogger().WithField(...). Entry.Level is the per-message level, which logrus only sets on the entry copy used during an actual log call; on these long-lived entries it stays at the zero value, PanicLevel (0). A comparison like log.Logger().Level >= logrus.DebugLevel is therefore always 0 >= 5, i.e. false, regardless of the configured verbosity.
Three call sites gate debug diagnostics this way, so those diagnostics can never be enabled:
auth/services/irma/signer.go:121: the QR code for an IRMA session is never printed.vcr/search.go:104: the debug summary of credentials filtered out of search results (error message counts) is never logged.storage/engine.go:428:goose.SetVerbose()always receivesfalse, so migration verbosity cannot be switched on.
None of these discloses anything; they are missing diagnostics only. The fix is to repair the check, for example with logrus.IsLevelEnabled(logrus.DebugLevel) as already used correctly at vcr/api/vcr/v2/registry.go:68 (valid because the module loggers wrap the standard logger), or log.Logger().Logger.IsLevelEnabled(...).
A fourth instance in the HTTP request logger gated request header capture, including the Authorization header. That one was removed rather than repaired in #4437, because enabling it would have written bearer tokens to the logs.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the checks at auth/services/irma/signer.go:121, vcr/search.go:104, and storage/engine.go:428, comparing them with the working pattern in vcr/api/vcr/v2/registry.go:68. Verify that configured debug logging enables the QR, filtered-credential summary, and migration verbosity, while the removed HTTP request-header capture remains absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100