本文整理汇总了Python中Logging.setup_logging方法的典型用法代码示例。如果您正苦于以下问题:Python Logging.setup_logging方法的具体用法?Python Logging.setup_logging怎么用?Python Logging.setup_logging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logging
的用法示例。
在下文中一共展示了Logging.setup_logging方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestLabHandler
# 需要导入模块: import Logging [as 别名]
# 或者: from Logging import setup_logging [as 别名]
self.write(VMManager.execute(command))
class TestLabHandler(tornado.web.RequestHandler):
def post(self):
post_data = dict(urlparse.parse_qsl(self.request.body))
Logging.LOGGER.info("VMManagerServer: TestLabHandler: post(): post_data = %s" % str(post_data))
self.write(VMManager.test_lab(post_data['lab_src_url'], post_data.get('version', None)))
def get(self):
Logging.LOGGER.info("VMManagerServer: TestLabHandler: get()")
self.write("Hello World")
if __name__ == "__main__":
Logging.setup_logging()
Logging.LOGGER.info("VMManagerServer: __main()")
tornado.options.parse_command_line()
app = tornado.web.Application(
handlers=[
(r"/api/1.0/disk-usage", DiskUsageHandler),
(r"/api/1.0/mem-usage", MemUsageHandler),
(r"/api/1.0/running-time", RunningTimeHandler),
(r"/api/1.0/running-processes", RunningProcHandler),
(r"/api/1.0/cpu-load", CPULoadHandler),
(r"/api/1.0/execute/([\w*\d*\%\-]+)", ExecuteHandler),
(r"/api/1.0/test-lab", TestLabHandler)
],
debug = False)
http_server = tornado.httpserver.HTTPServer(app)
http_server.listen(options.port)