Log more info in verbose mode
Clarification and motivation
Right now, in verbose mode, we only log which files/links/anchors will be analyzed.
IMO, in verbose mode, we should log more info to give us some insight into what's happening internally. A few things that come to mind (feel free to suggest more):
- When
--check-localhostis not enabled and we find a localhost link, we should print something like "Ignoring localhost link: " - When parsing a
Retry-Afterheader and the header value is somehow malformed, we should print this to stdout.
Acceptance criteria
When in verbose mode, we print the info listed above (and possibly more) to stdout.
I had an idea to also highlight the files we will ignore during the check, similar to "Ignoring localhost link:" from your first proposal (when the user provides filepaths to the --ignored flag), for the user to be absolutely sure they provided their desired collection of filepaths to bypass the verification;
but it would consequently imply that we will need to stop throwing away ignored filepaths during gatherRepoInfo and instead filter the files to scan in verifyRepo, since the verbose logging occurs in between those function calls and targets the repository information gathered with the former function. What do you think about it?
@breakerzirconia
I had an idea to also highlight the files we will ignore during the check, similar to "Ignoring localhost link:"
Good idea, I like that!
but it would consequently imply that we will need to stop throwing away ignored filepaths during gatherRepoInfo and instead filter the files to scan in verifyRepo, since the verbose logging occurs in between those function calls
I think we should do the logging inside Verify and Scan, not just in-between.
That's what I had in mind when I suggested printing ignored localhost links: we do the logging in checkExternalResource.
One more use case: I added a regex to ignoreRefs, but there's no easy way to tell if that regex is correctly ignoring the links I want to be ignored. It would be helpful if -v helped me figuring that out.