【发布时间】:2013-11-22 17:34:45
【问题描述】:
我只能看到警告和错误,我怎样才能得到信息和调试打印出来?澄清一下,我用python app.py 启动龙卷风应用程序。我希望在运行应用程序后将信息和调试日志打印到控制台。
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write('hello fun fun test world from tornado super')
logging.info('info')
logging.warning('warning')
logging.error('error')
logging.debug('debug')
application = tornado.web.Application([(r"/", MainHandler)], debug=True)
【问题讨论】:
-
您将
logger.setLevel()设置为什么?您可能需要将其设置为logging.DEBUG -
谢谢,这正是我需要做的!
-
我更新了答案,使其更全面。