How do I write to the console in Google App Engine?

前端 未结 11 1668
终归单人心
终归单人心 2020-12-08 09:30

Often when I am coding I just like to print little things (mostly the current value of variables) out to console. I don\'t see anything like this for Google App Engine, alth

11条回答
  •  佛祖请我去吃肉
    2020-12-08 09:51

    If you're using a more recent version of the Python Development Server (releases > 1.7.6, or Mar 2013 and later), these seem to be the right steps to use:

    1. Include the following in your script,

      import logging logging.debug("something I want to log")

    2. And per this docs page, set a flag by going to Edit > Application Settings > Launch Settings > Extra Command Line Flags, and adding,

      --log_level=debug

提交回复
热议问题