From 4b02dc95653f8c24be1effa8c94e9b3646595b68 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 11 Sep 2024 10:43:22 +0200 Subject: [PATCH] make cli mode respect log.level (#2124) Fixes #2119 Signed-off-by: Kristoffer Dalby --- hscontrol/types/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hscontrol/types/config.go b/hscontrol/types/config.go index 8767077e..50ce2f07 100644 --- a/hscontrol/types/config.go +++ b/hscontrol/types/config.go @@ -732,6 +732,9 @@ func prefixV6() (*netip.Prefix, error) { // LoadCLIConfig returns the needed configuration for the CLI client // of Headscale to connect to a Headscale server. func LoadCLIConfig() (*Config, error) { + logConfig := logConfig() + zerolog.SetGlobalLevel(logConfig.Level) + return &Config{ DisableUpdateCheck: viper.GetBool("disable_check_updates"), UnixSocket: viper.GetString("unix_socket"), @@ -741,6 +744,7 @@ func LoadCLIConfig() (*Config, error) { Timeout: viper.GetDuration("cli.timeout"), Insecure: viper.GetBool("cli.insecure"), }, + Log: logConfig, }, nil }