From 07048ea21953131d5022ab3289ec695e0cce4af7 Mon Sep 17 00:00:00 2001 From: James Fargher Date: Thu, 10 Jun 2021 08:58:10 +1200 Subject: Extract typed environment variable helpers These helpers should make parsing typed environment variables more consistent. --- cmd/gitaly-wrapper/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/gitaly-wrapper') diff --git a/cmd/gitaly-wrapper/main.go b/cmd/gitaly-wrapper/main.go index 1239d4503..3ac422070 100644 --- a/cmd/gitaly-wrapper/main.go +++ b/cmd/gitaly-wrapper/main.go @@ -13,6 +13,7 @@ import ( "github.com/sirupsen/logrus" "gitlab.com/gitlab-org/gitaly/v14/internal/bootstrap" + "gitlab.com/gitlab-org/gitaly/v14/internal/helper/env" "gitlab.com/gitlab-org/gitaly/v14/internal/log" "gitlab.com/gitlab-org/gitaly/v14/internal/ps" "golang.org/x/sys/unix" @@ -177,5 +178,6 @@ func pidFile() string { } func jsonLogging() bool { - return os.Getenv(envJSONLogging) == "true" + enabled, _ := env.GetBool(envJSONLogging, false) + return enabled } -- cgit v1.2.3