Google App Engine:登录开发控制台? [英] Google App Engine: Logging in dev console?

查看:100
本文介绍了Google App Engine:登录开发控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

日志工作在开发服务器上吗?此代码不会引发异常,但我看不到在devserver控制台中查看日志的位置。或许我在找错地方?

$ $ $ $ $ $ $ $ $ log.error(发生错误)
code>


解决方案

确保您创建了记录器。这应该工作。

代码

 导入记录

logging.getLogger().setLevel(logging.DEBUG)

logging.error(uuu)
logging.info(ggg)

从CLI启动

  $ dev_appserver。 py〜/ workspace / helloworld / 

我在CLI上得到的日志...

 错误2012-11-26 03:02:25,467 helloworld.py:89] uuu 
INFO 2012-11-26 03: 02:25,467 helloworld.py:90] ggg

请注意,这也适用于Tornado。 / p>

Does logging work on the dev server? This code doesn't raise an exception, but I can't see where to view the logs in the devserver console. Perhaps I'm looking in the wrong place?

logging.error("error has occurred")

解决方案

Make sure you create your logger. This should work.

Code

import logging

logging.getLogger().setLevel(logging.DEBUG)

logging.error("uuu")
logging.info("ggg")

Launching from the CLI

$dev_appserver.py ~/workspace/helloworld/

The logs I got on the CLI...

ERROR    2012-11-26 03:02:25,467 helloworld.py:89] uuu
INFO     2012-11-26 03:02:25,467 helloworld.py:90] ggg

Note that this also works for me in Tornado.

这篇关于Google App Engine:登录开发控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆