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

@ -8,6 +8,7 @@ import (
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
"github.com/juanfont/headscale/hscontrol/util"
"github.com/juanfont/headscale/hscontrol/util/zlog/zf"
"github.com/pterm/pterm"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
@ -81,7 +82,7 @@ var createUserCmd = &cobra.Command{
defer cancel()
defer conn.Close()
log.Trace().Interface("client", client).Msg("Obtained gRPC client")
log.Trace().Interface(zf.Client, client).Msg("Obtained gRPC client")
request := &v1.CreateUserRequest{Name: userName}
@ -107,7 +108,7 @@ var createUserCmd = &cobra.Command{
request.PictureUrl = pictureURL
}
log.Trace().Interface("request", request).Msg("Sending CreateUser request")
log.Trace().Interface(zf.Request, request).Msg("Sending CreateUser request")
response, err := client.CreateUser(ctx, request)
if err != nil {
ErrorOutput(