diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-10-26 01:04:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 01:04:48 +0200 |
commit | 0e15b4890a1d84f2aa800b745fdb0642d2ee966d (patch) | |
tree | dd6f3afc8f6f65d27f1389a950fc2cf64cf78943 /docs | |
parent | d1cce5caed1b9c3809ed5e2f80c9c413afd0c09a (diff) | |
download | psutil-0e15b4890a1d84f2aa800b745fdb0642d2ee966d.tar.gz |
PSUTIL_DEBUG: print file + line number for C ext modules (#2005)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst index 4ddddba5..6738f5a2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2553,6 +2553,30 @@ Running tests $ python3 -m psutil.tests +Debug mode +========== + +If you want to debug unusual situations or want to report a bug, it may be +useful to enable debug mode via ``PSUTIL_DEBUG`` environment variable. +In this mode, psutil may (or may not) print additional information to stderr. +Usually these are error conditions which are not severe, and hence are ignored +(instead of crashing). +Unit tests automatically run with debug mode enabled. +On UNIX: + +:: + + $ PSUTIL_DEBUG=1 python3 script.py + psutil-debug [psutil/_psutil_linux.c:150]> setmntent() failed (ignored) + +On Windows: + +:: + + set PSUTIL_DEBUG=1 python.exe script.py + psutil-debug [psutil/arch/windows/process_info.c:90]> NtWow64ReadVirtualMemory64(pbi64.PebBaseAddress) -> 998 (Unknown error) (ignored) + + Security ======== |