navi-offroute: enable INFO logging for per-stage timing

PR #34 added per-stage Auto timing logs (single-mode probing took..., hybrid
candidate gathering..., hybrid probing took...) at logger.info level, but
navi-offroute has no logging config, so Python's last-resort handler dropped
everything below WARNING and the lines never reached stderr/journal.

This one-line logging.basicConfig(level=logging.INFO) in app.py opens the gate so
those lines surface in journald, letting us localize the 6-7s baseline Auto
latency on in-town routes. No other changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt 2026-05-27 02:43:46 +00:00
commit 6b8bf15c36

View file

@ -3,6 +3,7 @@
Gunicorn entry:
gunicorn 'services.navi_offroute.app:create_app()' --bind 127.0.0.1:8428 --workers 2
"""
import logging
import time
from flask import Flask
@ -14,6 +15,11 @@ from .mvum import MVUMSpatialIndex
from .mvum_transitions import load_trailheads
from .mvum_parking import load_parking_index
# Emit INFO+ so PR #34 per-stage Auto timing logs (single-mode probing took...,
# hybrid candidate gathering..., hybrid probing took...) reach stderr/journal;
# navi-offroute had no logging config, so the last-resort handler dropped INFO.
logging.basicConfig(level=logging.INFO)
# Process-wide singleton: build the MVUM spatial index once per process (per gunicorn
# worker in prod; once across create_app() calls in tests), not once per app instance.
_MVUM_INDEX = None