diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2024-02-19 04:05:28 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2024-02-19 04:05:28 +0300 |
commit | 847ee95d12d65472bf4e9d4c7f50d4b8fc1ea92e (patch) | |
tree | 7ac46be7a0539d2845aa1e8cbc8a2635740c9d4b /include/py/homekit/http/http.py | |
parent | aff34d50b7dc1315a1d867266c4608ebea9685ca (diff) |
logging fixes
Diffstat (limited to 'include/py/homekit/http/http.py')
-rw-r--r-- | include/py/homekit/http/http.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/py/homekit/http/http.py b/include/py/homekit/http/http.py index a8c7d82..b1d33d3 100644 --- a/include/py/homekit/http/http.py +++ b/include/py/homekit/http/http.py @@ -7,6 +7,7 @@ from aiohttp import web from aiohttp.web import HTTPFound from aiohttp.web_exceptions import HTTPNotFound from ..util import stringify, format_tb, Addr +from ..config import is_development_mode _logger = logging.getLogger(__name__) @@ -67,6 +68,8 @@ async def errors_handler_middleware(request, handler): def serve(addr: Addr, before_start=None, handle_signals=True, routes=None, event_loop=None): + logging.getLogger('aiohttp').setLevel(logging.DEBUG if is_development_mode() else logging.WARNING) + app = web.Application() app.middlewares.append(errors_handler_middleware) |