Skip to content
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

how to diasable debug msg #1385

Closed
Ratgor opened this issue Dec 21, 2018 · 3 comments
Closed

how to diasable debug msg #1385

Ratgor opened this issue Dec 21, 2018 · 3 comments
Labels

Comments

@Ratgor
Copy link

Ratgor commented Dec 21, 2018

how to disable psutil debug messages?

I'm using psutil 5.4.7 with python 3.4 on winXP

and getting a lot of
"psutil-debug> GetActiveProcessorCount() not available;
usingGetNativeSystemInfo()"

I'm looking for python command (better) or environment variable,
but can't find a solution,
not in docs https://psutil.readthedocs.io/en/latest/index.html#,
nor in notes #1173

e.g., this doesn't help (and, maybe, shouldn't):

in script.py:
...
try: print("PSUTIL_DEBUG = {}".format(os.environ["PSUTIL_DEBUG"]))
except Exception as e: print(e)

os.environ["PSUTIL_DEBUG"] = "0"
print("PSUTIL_DEBUG = {}".format(os.environ["PSUTIL_DEBUG"]))
...

in win powerShell:
PS ... > cmd /c "set PSUTIL_DEBUG=0 && python .\script.py"
PSUTIL_DEBUG = 0
PSUTIL_DEBUG = 0

@giampaolo
Copy link
Owner

giampaolo commented Dec 21, 2018

Mmm this is weird. I thought I had already fixed this. Can you try upgrading to 5.4.8?

@Ratgor
Copy link
Author

Ratgor commented Dec 23, 2018

Thanks!
I have upgraded to 5.4.8, that fix my problem.

With 5.4.8, if environ var PSUTIL_DEBUG doesn't exist or empty before first psutil import,
there are no debug msgs.
To re-enable them I should create and set the var to a non-empty value.

@giampaolo
Copy link
Owner

Good. ;)

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

No branches or pull requests

2 participants