Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug GAE python, gql and datastore?

I have been struggling to find ways to debug some python scripts and gql datastore queries in GAE using textmate.

For the gql queries, can we print the queries to see what's in the database? (like php print_r function).

For the .py files, anyway we can log it? I tried using logging module. logging.info or logging.debug doesn't seem to return anything in the browser or the GAE console.log. Where does it suppose to return the output?

Any help will be appreciated!

like image 627
tipsywacky Avatar asked Dec 28 '12 10:12

tipsywacky


1 Answers

You can use the Console which will allow you to run Python commands directly in production. Here is a question relating to that. The interactive console may help debug those queries a bit faster.

logging.debug does work, but it logs to the log system on your app engine admin panel. Go to appengine.google.com, select your application then click on "logs". Then select "Logs with minimum severity: Debug" and you'll see your logging info.

like image 125
Paul Collingwood Avatar answered Sep 19 '22 04:09

Paul Collingwood