I'm working with Django-nonrel on Google App Engine, which forces me to use logging.debug()
instead of print()
.
The "logging" module is provided by Django, but I'm having a rough time using it instead of print()
.
For example, if I need to verify the content held in the variable x, I will put
logging.debug('x is: %s' % x)
. But if the program crashes soon after (without flushing the stream), then it never gets printed.
So for debugging, I need debug()
to be flushed before the program exits on error, and this is not happening.
print
anyway?! – Apcexit()
) around it...which waited for1
second(time.sleep(1)
) before exiting the Application. I am also catching any unexpected error and callingexit()
method. This timeout seems to flushout any pending log messages – Terrify