-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Dynamically control debugging output #67223
Comments
When Python is compiled with some defined macros (e.g. COUNT_ALLOCS) it prints additional debugging output at shutdown. This additional output can cause tests failure (see bpo-19527). It would be good if Python will silent by default and produce debugging output only if special command line option or environment variable is set. Debugging output switched by Py_REF_DEBUG is now enabled only when "-X showrefcount" is specified (bpo-17323). |
Also this debug output should be printed on stderr, not stdout. |
Yes, I like the idea of doing that for other debug options. |
Here is (conceivably incomplete) list of debugging and tracing output (but not Controlled output. Import and shutdown details -- controlled by the -v flag. Uncomtrolled output. To stderr: In PyType_ClearCache (Objects/typeobject.c) if MCACHE_STATS is defined. To stdout: In Modules/_ctypes/malloc_closure.c if MALLOC_CLOSURE_DEBUG is defined. There is also dead code in Parser/parsetok.c, Parser/tokenizer.c, |
Proposed patch adds the "-X showalloccount" option, that turn on the output of allocated objects counts if COUNT_ALLOCS, SHOW_ALLOC_COUNT, or SHOW_TRACK_COUNT are defined. The output of COUNT_ALLOCS is now written to stderr. |
New changeset cd911e06bf6c by Serhiy Storchaka in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: