fix(P1-1): PulseController Logging-Volumen reduziert — Tick-Logs von INFO auf DEBUG
This commit is contained in:
@@ -573,12 +573,12 @@ class PulseController:
|
|||||||
def pause(self) -> None:
|
def pause(self) -> None:
|
||||||
"""Pause pulsing without stopping the thread (EC-2: reconnect race)."""
|
"""Pause pulsing without stopping the thread (EC-2: reconnect race)."""
|
||||||
self._paused.set()
|
self._paused.set()
|
||||||
logger.info("[pulse] PulseController paused")
|
logger.debug("[pulse] PulseController paused")
|
||||||
|
|
||||||
def resume(self) -> None:
|
def resume(self) -> None:
|
||||||
"""Resume pulsing after pause (EC-2: reconnect race)."""
|
"""Resume pulsing after pause (EC-2: reconnect race)."""
|
||||||
self._paused.clear()
|
self._paused.clear()
|
||||||
logger.info("[pulse] PulseController resumed")
|
logger.debug("[pulse] PulseController resumed")
|
||||||
|
|
||||||
def is_running(self) -> bool:
|
def is_running(self) -> bool:
|
||||||
"""Check if the pulse thread is running."""
|
"""Check if the pulse thread is running."""
|
||||||
@@ -605,14 +605,14 @@ class PulseController:
|
|||||||
# Check if paused
|
# Check if paused
|
||||||
if self._paused.is_set():
|
if self._paused.is_set():
|
||||||
if iteration == 1 or iteration % 50 == 0:
|
if iteration == 1 or iteration % 50 == 0:
|
||||||
logger.info(
|
logger.debug(
|
||||||
"[pulse] _pulse_loop iteration=%d: PAUSED (waiting for resume)",
|
"[pulse] _pulse_loop iteration=%d: PAUSED (waiting for resume)",
|
||||||
iteration,
|
iteration,
|
||||||
)
|
)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.info(
|
logger.debug(
|
||||||
"[pulse] _pulse_loop iteration=%d: calling _pulse_tick, phase=%s, ddp=%s",
|
"[pulse] _pulse_loop iteration=%d: calling _pulse_tick, phase=%s, ddp=%s",
|
||||||
iteration,
|
iteration,
|
||||||
self._phase,
|
self._phase,
|
||||||
@@ -630,7 +630,7 @@ class PulseController:
|
|||||||
|
|
||||||
def _pulse_tick(self) -> None:
|
def _pulse_tick(self) -> None:
|
||||||
"""Execute one pulse tick: toggle phase and send status."""
|
"""Execute one pulse tick: toggle phase and send status."""
|
||||||
logger.info(
|
logger.debug(
|
||||||
"[pulse] _pulse_tick fired, phase=%s, ddp=%s, paused=%s, cancel_pending=%s",
|
"[pulse] _pulse_tick fired, phase=%s, ddp=%s, paused=%s, cancel_pending=%s",
|
||||||
self._phase,
|
self._phase,
|
||||||
self._ddp is not None,
|
self._ddp is not None,
|
||||||
@@ -641,7 +641,7 @@ class PulseController:
|
|||||||
# P0-2: Check cancel_pending flag (set by PresenceEngine._set_presence)
|
# P0-2: Check cancel_pending flag (set by PresenceEngine._set_presence)
|
||||||
if self._cancel_pending:
|
if self._cancel_pending:
|
||||||
self._cancel_pending = False
|
self._cancel_pending = False
|
||||||
logger.info("[pulse] _pulse_tick skip: cancel_pending was set")
|
logger.debug("[pulse] _pulse_tick skip: cancel_pending was set")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Toggle phase
|
# Toggle phase
|
||||||
@@ -649,14 +649,14 @@ class PulseController:
|
|||||||
|
|
||||||
# Coalesce: skip if same phase as last sent
|
# Coalesce: skip if same phase as last sent
|
||||||
if self._phase == self._last_sent_phase:
|
if self._phase == self._last_sent_phase:
|
||||||
logger.info(
|
logger.debug(
|
||||||
"[pulse] _pulse_tick skip: coalesce (phase=%s == last_sent)",
|
"[pulse] _pulse_tick skip: coalesce (phase=%s == last_sent)",
|
||||||
self._phase,
|
self._phase,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
status = "away" if self._phase else "online"
|
status = "away" if self._phase else "online"
|
||||||
logger.info("[pulse] _pulse_tick sending: status=%s", status)
|
logger.debug("[pulse] _pulse_tick sending: status=%s", status)
|
||||||
|
|
||||||
# Try DDP first (K1: DDP set_status has no message variant)
|
# Try DDP first (K1: DDP set_status has no message variant)
|
||||||
if self._ddp is not None and getattr(self._ddp, 'connected', False):
|
if self._ddp is not None and getattr(self._ddp, 'connected', False):
|
||||||
@@ -664,7 +664,7 @@ class PulseController:
|
|||||||
self._ddp.set_status(status)
|
self._ddp.set_status(status)
|
||||||
self._last_sent_phase = self._phase
|
self._last_sent_phase = self._phase
|
||||||
self._increment_telemetry()
|
self._increment_telemetry()
|
||||||
logger.info("[pulse] _pulse_tick DDP set_status OK: %s", status)
|
logger.debug("[pulse] _pulse_tick DDP set_status OK: %s", status)
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.info("[pulse] _pulse_tick DDP set_status failed: %s", e)
|
logger.info("[pulse] _pulse_tick DDP set_status failed: %s", e)
|
||||||
@@ -685,11 +685,11 @@ class PulseController:
|
|||||||
)
|
)
|
||||||
self._last_sent_phase = self._phase
|
self._last_sent_phase = self._phase
|
||||||
self._increment_telemetry()
|
self._increment_telemetry()
|
||||||
logger.info("[pulse] _pulse_tick REST setStatus OK: %s", status)
|
logger.debug("[pulse] _pulse_tick REST setStatus OK: %s", status)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.info("[pulse] _pulse_tick REST setStatus failed: %s", e)
|
logger.info("[pulse] _pulse_tick REST setStatus failed: %s", e)
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.debug(
|
||||||
"[pulse] _pulse_tick skip: no DDP and no REST available (ddp=%s, rest=%s)",
|
"[pulse] _pulse_tick skip: no DDP and no REST available (ddp=%s, rest=%s)",
|
||||||
self._ddp is not None,
|
self._ddp is not None,
|
||||||
self._rest is not None,
|
self._rest is not None,
|
||||||
|
|||||||
Reference in New Issue
Block a user