Skip to content

Commit

Permalink
Supress http server logging
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Jan 19, 2023
1 parent 2301315 commit 9ce7799
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions webview/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def __init__(self):
self.js_api_endpoint = None
self.uid = str(uuid.uuid1())


@classmethod
def start_server(self, urls, http_port):
from webview import _debug
Expand Down Expand Up @@ -66,7 +65,6 @@ def js_api():
else:
logger.error('JS callback function is not set for window %s' % body['uid'])


@app.route('/')
@app.route('/<file:path>')
def asset(file):
Expand All @@ -79,7 +77,7 @@ def asset(file):

server.root_path = abspath(common_path) if common_path is not None else None
server.port = http_port or _get_random_port()
server.thread = threading.Thread(target=lambda: bottle.run(app=app, port=server.port, quiet=not _debug), daemon=True)
server.thread = threading.Thread(target=lambda: bottle.run(app=app, port=server.port, quiet=not _debug['mode']), daemon=True)
server.thread.start()

server.running = True
Expand All @@ -94,6 +92,7 @@ def start_server(urls, http_port=None, server=BottleServer, **server_args):
server = server if not server is None else BottleServer
return server.start_server(urls, http_port, **server_args)


def start_global_server(http_port=None, urls='.', server=BottleServer, **server_args):
global global_server
address, common_path, global_server = start_server(urls=urls, http_port=http_port, server=server, **server_args)
Expand Down

0 comments on commit 9ce7799

Please sign in to comment.