xrefcheck icon indicating copy to clipboard operation
xrefcheck copied to clipboard

Log more info in verbose mode

Open dcastro opened this issue 4 years ago • 3 comments

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):

  1. When --check-localhost is not enabled and we find a localhost link, we should print something like "Ignoring localhost link: "
  2. When parsing a Retry-After header 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.

dcastro avatar Nov 04 '21 15:11 dcastro

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 avatar Nov 24 '21 15:11 breakerzirconia

@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.

dcastro avatar Dec 07 '21 16:12 dcastro

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.

dcastro avatar Jul 27 '22 10:07 dcastro