Skip to content

Commit

Permalink
immediately start debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
steersbob committed Jan 24, 2024
1 parent 105f4a7 commit a7704b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions brewblox_history/app_factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import debugpy
import logging
from contextlib import AsyncExitStack, asynccontextmanager
from pprint import pformat
Expand All @@ -12,6 +13,11 @@
LOGGER = logging.getLogger(__name__)


debugpy.listen(('0.0.0.0', 5678))
debugpy.wait_for_client()
debugpy.breakpoint()


def setup_logging(debug: bool):
level = logging.DEBUG if debug else logging.INFO
unimportant_level = logging.INFO if debug else logging.WARN
Expand Down Expand Up @@ -64,11 +70,7 @@ def create_app() -> FastAPI:
import faulthandler
faulthandler.enable()

import debugpy
debugpy.listen(('0.0.0.0', 5678))
LOGGER.info('Debugger is enabled and listening on 5678')
debugpy.wait_for_client()
debugpy.breakpoint()

# Call setup functions for modules
mqtt.setup()
Expand Down

0 comments on commit a7704b4

Please sign in to comment.