From 93a8d59cd9f7a511e3132de76115c43cba49cfec Mon Sep 17 00:00:00 2001 From: Darell Tan Date: Mon, 12 Jan 2026 23:17:02 +0800 Subject: [PATCH] Added more debugging output and microsecond log timestamps --- bridge.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bridge.go b/bridge.go index 6a47767..ffec316 100644 --- a/bridge.go +++ b/bridge.go @@ -189,6 +189,9 @@ func (br *Bridge) StartHAP() error { if br.DebugMode { haplog.Debug.Enable() + + // add microseconds to log output + log.SetFlags(log.LstdFlags | log.Lmicroseconds) } err = br.server.ListenAndServe(br.ctx) @@ -579,11 +582,17 @@ wait: // updatedVal is float64 coz that's how Z2M JSON values are, but expVal may not be mapping.ExposesEntry.Type == "numeric" && cmpFloat64Numeric(updatedVal, expVal) { + if br.DebugMode { + log.Printf("Z2M state %q for %s updated to %q", prop, key, updatedVal) + } updated = true break wait } case <-ctx.Done(): + if br.DebugMode { + log.Printf("Z2M state update %s timed out", key) + } break wait } }