cmd: use zf constants for zerolog field names

Update CLI logging to use zf.* constants instead of inline strings
for consistency with the rest of the codebase.
This commit is contained in:
Kristoffer Dalby
2026-01-28 14:39:34 +00:00
parent 27f5641341
commit b5090a01ec
3 changed files with 7 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/juanfont/headscale/hscontrol"
"github.com/juanfont/headscale/hscontrol/types"
"github.com/juanfont/headscale/hscontrol/util"
"github.com/juanfont/headscale/hscontrol/util/zlog/zf"
"github.com/rs/zerolog/log"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
@@ -118,7 +119,7 @@ func newHeadscaleCLIWithConfig() (context.Context, v1.HeadscaleServiceClient, *g
}
}
log.Trace().Caller().Str("address", address).Msg("Connecting via gRPC")
log.Trace().Caller().Str(zf.Address, address).Msg("Connecting via gRPC")
conn, err := grpc.DialContext(ctx, address, grpcOptions...)
if err != nil {
log.Fatal().Caller().Err(err).Msgf("Could not connect: %v", err)