Only turn on response log in grpc in trace mode
@@ -26,6 +26,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
"github.com/philip-bui/grpc-zerolog"
+ zl "github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/soheilhy/cmux"
ginprometheus "github.com/zsais/go-gin-prometheus"
@@ -480,6 +481,12 @@ func (h *Headscale) Serve() error {
WriteTimeout: 0,
}
+ if zl.GlobalLevel() == zl.TraceLevel {
+ zerolog.RespLog = true
+ } else {
+ zerolog.RespLog = false
+ }
+
grpcOptions := []grpc.ServerOption{
grpc.UnaryInterceptor(
grpc_middleware.ChainUnaryServer(
