bandersnatch icon indicating copy to clipboard operation
bandersnatch copied to clipboard

Add Debug logging to filtering modules

Open lps-rocks opened this issue 5 years ago • 5 comments

Edit: Updated title. Seems there's just no debug logging in the filtering modules for matching.

Using --debug with verify doesn't actually print any debug level messages to the console. They're all flagged as INFO. This makes debugging filtering impossible.

lps-rocks avatar Jul 13 '20 21:07 lps-rocks

Thanks for reporting. Filtering does not work with verify tho, only mirror. However, verify must be missing the call to setup debug logging. Should be an easy fix. Will look into it when I next get time.

cooperlees avatar Jul 13 '20 23:07 cooperlees

--debug works for me when using it together with verify:

#> ~ bandersnatch -c /tmp/bandersnatch/config.ini --debug verify
2020-07-29 20:27:58,975 INFO: Starting verify for /tmp/bandersnatch/pypi with 3 workers
2020-07-29 20:27:58,976 DEBUG: Found 1 objects in /tmp/bandersnatch/pypi/web/json
2020-07-29 20:27:58,976 DEBUG: Using a 3 thread ThreadPoolExecutor
2020-07-29 20:27:58,976 DEBUG: Initializing Master's aiohttp ClientSession
2020-07-29 20:27:58,978 INFO: Parsing pip
2020-07-29 20:27:59,523 INFO: Finished validating pip
2020-07-29 20:27:59,524 DEBUG: Closing Master's aiohttp ClientSession and waiting 0.1 seconds

The call to setup_logging is within the main() right after the call to parse_args so should be present for any and all subcommands unless invoked by importing the module from a python script but at that stage it should be expected that the calling script sets up the logging.

Should be closed.

lepaperwan avatar Jul 29 '20 18:07 lepaperwan

So I updated the title, this was specifically a problem where I wasn't seeing any DEBUG information coming from the filtering modules. Turns out there's just no debug logging in place for the filtering modules so it's incredibly difficult to debug.

lps-rocks avatar Jul 29 '20 18:07 lps-rocks

PR welcome! :D

cooperlees avatar Jul 30 '20 15:07 cooperlees

When I get some time I can do this :)

On Jul 30, 2020, at 10:35 AM, Cooper Lees [email protected] wrote:



PR welcome! :D

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pypa/bandersnatch/issues/614#issuecomment-666464475, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTDUVZOGQX2BYDCMDBTO5DR6GHMBANCNFSM4OY44LGA .

lps-rocks avatar Jul 30 '20 15:07 lps-rocks