summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/py/homekit/config/config.py1
-rw-r--r--include/py/homekit/http/http.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/py/homekit/config/config.py b/include/py/homekit/config/config.py
index c5cc415..4609ee5 100644
--- a/include/py/homekit/config/config.py
+++ b/include/py/homekit/config/config.py
@@ -54,7 +54,6 @@ class BaseConfigUnit(ABC):
return key in self._data
def load_from(self, path: str):
- print(f'loading config from {path}')
with open(path, 'r') as fd:
self._data = yaml.safe_load(fd)
if self._data is None:
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)