[log] Add debug logging to urlutil/domains#8005
Merged
Merged
Conversation
Add logDomains debug logger (urlutil:domains namespace) and 4 meaningful log calls to ExtractURLDomains and ExtractURLDomainsFromValue: - Log URL candidate count found by regex - Log unparseable URL candidates (for troubleshooting regex edge cases) - Log final unique domain count resolved from candidates - Log when no domains are found in the value tree Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds debug logging to internal/urlutil/domains.go to make it easier to trace how URL candidates are found and how many unique domains are extracted, which is useful for diagnosing DIFC write-sink guard and JQ schema middleware behavior.
Changes:
- Added a debug logger (
logDomains) in theurlutil:domainsnamespace. - Added debug logs for candidate counts and final unique domain counts in
ExtractURLDomainsandExtractURLDomainsFromValue. - Added debug logging when URL candidates cannot be parsed.
Show a summary per file
| File | Description |
|---|---|
| internal/urlutil/domains.go | Introduces a urlutil:domains debug logger and emits domain-extraction diagnostics (counts + parse failure visibility). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Jun 24, 2026
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.
Adds a
logDomainsdebug logger (urlutil:domainsnamespace) and 4 meaningful debug log calls tointernal/urlutil/domains.go.Changes
File:
internal/urlutil/domains.gologgerimport andvar logDomains = logger.New("urlutil:domains")declarationExtractURLDomains: logs the number of URL candidates found by the regex, logs unparseable URL candidates (useful when debugging edge cases with the regex), and logs the final unique domain countExtractURLDomainsFromValue: logs when no domains are found in the value tree, and logs the final extracted domain countWhy this file
urlutil.ExtractURLDomainsFromValueandExtractURLDomainsare called from the DIFC write-sink guard (guard/write_sink.go) and the JQ schema middleware (middleware/jqschema.go) to determine which domains appear in tool arguments/responses. Debug logging here helps trace:Validation
go vet ./internal/urlutil/✅go build✅go test $(go list ./... | grep -v test/integration)) ✅