cleanup: WATCHDOG_CHECK 디버그 로그 제거 (이벤트성 로그만 유지)
WATCHDOG_STARTED/TIMEOUT/GATT_ERROR/RECONNECT 등 이벤트 로그는 유지. 5초마다 찍히던 WATCHDOG_CHECK/THREAD 상태 로그 제거. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -364,27 +364,12 @@ class BleManager private constructor(private val context: Context) {
|
|||||||
debugLogger.info("WATCHDOG_STARTED timeout=${watchdogTimeoutMs}ms")
|
debugLogger.info("WATCHDOG_STARTED timeout=${watchdogTimeoutMs}ms")
|
||||||
|
|
||||||
watchdogJob = Thread({
|
watchdogJob = Thread({
|
||||||
debugLogger.info("WATCHDOG_THREAD running")
|
|
||||||
while (watchdogRunning) {
|
while (watchdogRunning) {
|
||||||
try { Thread.sleep(5000) } catch (e: InterruptedException) {
|
try { Thread.sleep(5000) } catch (_: InterruptedException) { break }
|
||||||
debugLogger.warn("WATCHDOG_THREAD interrupted")
|
if (!watchdogRunning) break
|
||||||
break
|
if (!isConnected.value) break
|
||||||
}
|
|
||||||
if (!watchdogRunning) {
|
|
||||||
debugLogger.info("WATCHDOG_THREAD stopped (flag)")
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
val silenceMs = System.currentTimeMillis() - lastRxTimestamp
|
val silenceMs = System.currentTimeMillis() - lastRxTimestamp
|
||||||
val connected = isConnected.value
|
|
||||||
debugLogger.info("WATCHDOG_CHECK silence=${silenceMs}ms connected=$connected")
|
|
||||||
|
|
||||||
// connected=false면 정상 경로에서 이미 처리됨 → watchdog 종료
|
|
||||||
if (!connected) {
|
|
||||||
debugLogger.info("WATCHDOG_STOP — already disconnected (handled by GATT callback)")
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
if (silenceMs > watchdogTimeoutMs) {
|
if (silenceMs > watchdogTimeoutMs) {
|
||||||
// 직접 로그 기록 (handler 블로킹 무관)
|
// 직접 로그 기록 (handler 블로킹 무관)
|
||||||
debugLogger.error("WATCHDOG_TIMEOUT silence=${silenceMs}ms — forcing reconnect")
|
debugLogger.error("WATCHDOG_TIMEOUT silence=${silenceMs}ms — forcing reconnect")
|
||||||
|
|||||||
Reference in New Issue
Block a user