From 2c4b9c85833b4b71b35fd1099271bd67aaa3b3b3 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:32:32 +0800 Subject: [PATCH] Add swss-common log level support to gnmi (#330) --- telemetry/telemetry.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telemetry/telemetry.go b/telemetry/telemetry.go index f310a4d7..4ebf6857 100644 --- a/telemetry/telemetry.go +++ b/telemetry/telemetry.go @@ -26,6 +26,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" + "github.com/sonic-net/sonic-gnmi/swsscommon" ) type ServerControlValue int @@ -88,6 +89,9 @@ func runTelemetry(args []string) error { return err } + // enable swss-common debug level + swsscommon.LoggerLinkToDbNative("telemetry") + var wg sync.WaitGroup // serverControlSignal channel is a channel that will be used to notify gnmi server to start, stop, restart, depending of syscall or cert updates var serverControlSignal = make(chan ServerControlValue, 1)