我们从Python开源项目中,提取了以下46个代码示例,用于说明如何使用paste.translogger.TransLogger()。
def run_server(app): # Enable WSGI access logging via Paste app_logged = TransLogger(app) # Mount the WSGI callable object (app) on the root directory cherrypy.tree.graft(app_logged, '/') # Set the configuration of the web server cherrypy.config.update({ 'engine.autoreload.on': True, 'log.screen': True, 'server.socket_port': int(configParser.get("server", "port")), 'server.socket_host': configParser.get("server", "host") }) # Start the CherryPy WSGI web server cherrypy.engine.start() cherrypy.engine.block()
def run_server(): # Enable WSGI access logging via Paste app_logged = TransLogger(app) # Mount the WSGI callable object (app) on the root directory cherrypy.tree.graft(app_logged, '/') # Set the configuration of the web server cherrypy.config.update({ 'engine.autoreload_on': True, 'log.screen': True, 'log.error_file': "cherrypy.log", 'server.socket_port': 5000, 'server.socket_host': '0.0.0.0', 'server.thread_pool': 50, # 10 is default }) # Start the CherryPy WSGI web server cherrypy.engine.start() cherrypy.engine.block() # Connection
def run_server(app): # Enable WSGI access logging via Paste app_logged = TransLogger(app) # Mount the WSGI callable object (app) on the root directory cherrypy.tree.graft(app_logged, '/') # Set the configuration of the web server cherrypy.config.update({ 'engine.autoreload.on': True, 'log.screen': True, 'server.socket_port': 5432, 'server.socket_host': '127.0.0.1' }) # Start the CherryPy WSGI web server cherrypy.engine.start() cherrypy.engine.block()
def run_server(app): # Enable WSGI access logging via Paste app_logged = TransLogger(app) # Mount the WSGI callable object (app) on the root directory cherrypy.tree.graft(app_logged, '/') # Set the configuration of the web server cherrypy.config.update({ 'engine.autoreload.on': True, 'log.screen': True, 'server.socket_port': 5432, 'server.socket_host': '0.0.0.0' }) # Start the CherryPy WSGI web server cherrypy.engine.start() cherrypy.engine.block()
def run(self, handler): # pragma: no cover from paste import httpserver from paste.translogger import TransLogger handler = TransLogger(handler, setup_console_handler=(not self.quiet)) httpserver.serve(handler, host=self.host, port=str(self.port), **self.options)
def build_wsgi_app(raml_file): # read raml, create router raml = ramlfications.parse(raml_file) resources = api.transform_resources(raml, raml.resources) resources = filter(filter_absent_method, resources) app = build_server(resources) print app.map app = TransLogger(app, setup_console_handler=False) return app
def run(self, handler): # pragma: no cover from paste import httpserver if not self.quiet: from paste.translogger import TransLogger handler = TransLogger(handler) httpserver.serve(handler, host=self.host, port=str(self.port), **self.options)