1

In a script of mine I am using a Python module and I know I can turn on that module's DEBUG prints by just doing:

LOGLEVEL=DEBUG python myscript.py

I am new to (real) debugging, so this is for sure a stupid question. What's the name of this kind of variable passing in Python?

2 Answers 2

2

It's an environment variable. The value is set and handled by the operating system, and the Python script in question checks the value to determine the granularity of the logging.

Sign up to request clarification or add additional context in comments.

Comments

1

The variable is an environment variable used with os.environ dict

import os
print(os.environ["LOGLEVEL"])

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.