From cd58e7a4292207a747bfa1b460dd262afe155558 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 3 Dec 2024 21:47:24 +0800 Subject: [PATCH] :loud_sound: Verbose broadcasting logging --- pkg/internal/directory/service_mapping.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/internal/directory/service_mapping.go b/pkg/internal/directory/service_mapping.go index 5439934..a319d89 100644 --- a/pkg/internal/directory/service_mapping.go +++ b/pkg/internal/directory/service_mapping.go @@ -121,14 +121,18 @@ func BroadcastEvent(event string, data any) error { Str("event", event). Msg("Broadcasting event from internal...") - for _, val := range resp.Kvs { + for idx, val := range resp.Kvs { var instance ServiceInstance if err := json.Unmarshal(val.Value, &instance); err != nil { + log.Error().Err(err).Int("index", idx). + Msg("Unable to parse instance config, skip broadcasting for it...") continue } conn, err := instance.GetGrpcConn() if err != nil { + log.Error().Err(err).Str("destination", instance.ID). + Msg("Unable to get grpc connection, skip broadcasting for it...") continue }