From 8f2699407d5c452e04bd0de8bbb367a60b4a88b8 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 13 Sep 2022 23:06:31 +0200 Subject: [PATCH] Make verbose checks in tryBranch (#127) - It's likely that the tryBranch is returning false when it should be returning true, make these logs more verbose so they show up on production logs. Co-authored-by: Gusted Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/127 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted Co-committed-by: Gusted --- server/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/handler.go b/server/handler.go index cd67aa7..ed06659 100644 --- a/server/handler.go +++ b/server/handler.go @@ -85,7 +85,7 @@ func Handler(mainDomainSuffix, rawDomain []byte, // also disallow search indexing and add a Link header to the canonical URL. tryBranch := func(log zerolog.Logger, repo, branch string, path []string, canonicalLink string) bool { if repo == "" { - log.Debug().Msg("tryBranch: repo is empty") + log.Warn().Msg("tryBranch: repo is empty") return false } @@ -96,7 +96,7 @@ func Handler(mainDomainSuffix, rawDomain []byte, // Check if the branch exists, otherwise treat it as a file path branchTimestampResult := upstream.GetBranchTimestamp(giteaClient, targetOwner, repo, branch, branchTimestampCache) if branchTimestampResult == nil { - log.Debug().Msg("tryBranch: branch doesn't exist") + log.Warn().Msg("tryBranch: branch doesn't exist") return false }