'''
This module provides some function to make running a webserver a little easier
'''


def gevent_run(app):
    from gevent.wsgi import WSGIServer
    import gevent.monkey
    from werkzeug.debug import DebuggedApplication
    gevent.monkey.patch_socket()
    run_app = app
    if app.config['DEBUG']:
        run_app = DebuggedApplication(app)

    def run_server():
        import logging
        port = int(app.config.get('PORT', 5000))
        address = app.config.get('ADDRESS', '')
        logging.getLogger('webant').info('Listening on http://{}:{}/'.format(address or '0.0.0.0', port))
        http_server = WSGIServer((address, port), run_app)
        http_server.serve_forever()

    if app.config['DEBUG']:
        from werkzeug._reloader import run_with_reloader
        run_with_reloader(run_server)
    else:
        run_server()

@@ -375,22 +375,69 @@
     
-import logging
+from gevent import version_info%0A%0A        logger = app._logger
 %0A   
@@ -546,31 +546,10 @@
 logg
-ing.getLogger('webant')
+er
 .inf
@@ -615,16 +615,207 @@
  port))%0A
+        server_params = dict()%0A        #starting from gevent version 1.1b1 we can pass custom logger to gevent%0A        if version_info%5B:2%5D %3E= (1,1):%0A            server_params%5B'log'%5D = logger%0A
         
@@ -863,16 +863,33 @@
  run_app
+, **server_params
 )%0A      

Use custom logger on gevent>=1.1