2016/11/16

[Google App Engine][Python]logをプログラムで出力させる

JavaScriptのconsole.logみたいな感じで、ログ画面にプログラムでデバッグ結果を出力することはできないのだろうか?

Reading and Writing Application Logs
で確認すると、

import logging
logging.info('This is an info message')
logging.warning('This is a warning message')
logging.error('This is an error message')
logging.critical('This is a critical message')
で出力することができるようだ。

確かに、infoメソッド使ったらログ画面に結果がでました。

0 コメント:

コメントを投稿