Skip to content

Adding logging when debug is enable #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
max246 opened this issue Dec 29, 2022 · 4 comments
Closed

Adding logging when debug is enable #459

max246 opened this issue Dec 29, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@max246
Copy link
Contributor

max246 commented Dec 29, 2022

It is handy if you can add some logging to this line which helps to understand what package is pulling the information without guessing what is wrong

https://github.com/pypa/pip-audit/blob/main/pip_audit/_cli.py#L465

I have used this solution to figure out what package was triggering the issue

logger.debug(f"Auditing {spec.name} ({spec.version})")

@max246 max246 added the enhancement New feature or request label Dec 29, 2022
@woodruffw
Copy link
Member

Thanks for the request. Could you clarify what about the current behavior isn't working for you? Does the current progress bar not freeze on failure and show you which audit was running when the command failed?

(Either way, I'm not opposed to an extra debug log here -- just want to make sure I understand what the problem is!)

@max246
Copy link
Contributor Author

max246 commented Dec 30, 2022

In my case where I had to debug why I had the setuptools flagging even if I had set the correct package, I couldnt figure out which package was getting the information from.
I could enable debug but what I could see is mostly cachecontrol pulling packages but didnt know which package was coming from.

Adding this line, I was able to identify in few seconds which package was pulling the wrong version.

You can see my logs on my previous ticket: #458

@woodruffw
Copy link
Member

Makes sense, thank you! Would you mind making a short PR for that debug line? Otherwise, I'll add it sometime tonight or this weekend.

@woodruffw
Copy link
Member

#460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants