From a275db3fdbebc2ef423153351b2705033f136d55 Mon Sep 17 00:00:00 2001 From: Cyrus Date: Mon, 2 Feb 2026 23:59:17 +0800 Subject: [PATCH] fix(logging): expand tilde in auth-dir and log resolution errors - Use util.ResolveAuthDir to properly expand ~ to user home directory - Fixes issue where logs were created in literal "~/.cli-proxy-api" folder - Add warning log when auth-dir resolution fails for debugging Bug introduced in 62e2b67 (refactor(logging): centralize log directory resolution logic), where strings.TrimSpace was used instead of util.ResolveAuthDir to process auth-dir path. --- internal/logging/global_logger.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/logging/global_logger.go b/internal/logging/global_logger.go index 28c9f3b9..372222a5 100644 --- a/internal/logging/global_logger.go +++ b/internal/logging/global_logger.go @@ -131,7 +131,10 @@ func ResolveLogDirectory(cfg *config.Config) string { return logDir } if !isDirWritable(logDir) { - authDir := strings.TrimSpace(cfg.AuthDir) + authDir, err := util.ResolveAuthDir(cfg.AuthDir) + if err != nil { + log.Warnf("Failed to resolve auth-dir %q for log directory: %v", cfg.AuthDir, err) + } if authDir != "" { logDir = filepath.Join(authDir, "logs") }