I'd like a global variable to determine if I'm in debug mode or not. Is that what __debug__
is for? How do I set/read it on Google App Engine?
If I use logging.debug()
, will that automatically be turned off if I don't run the app with debug=True
?
application = webapp.WSGIApplication(# ...
debug=True)
__debug__
is built-in constant defined by Python. The docs say this: "This constant is true if Python was not started with an -O option. Assignments to debug are illegal and raise a SyntaxError. See also the assert statement."
The debug=True
you pass to webapp.WSGIApplication
is completely separate.
Neither of these will affect logging.debug()
either. You can use logging.setLevel()
to control how logging.debug()
is handled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With