From 5bbc23d78f1c93af7f943f94a6f67dfc01533ebf Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Sat, 19 Aug 2023 00:13:17 +0800 Subject: [PATCH] Use logger instead of fmt Done because this is running outside a script. --- internal/testutils/testutils.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/testutils/testutils.go b/internal/testutils/testutils.go index 23731ed..6c27126 100644 --- a/internal/testutils/testutils.go +++ b/internal/testutils/testutils.go @@ -1,11 +1,10 @@ package testutils import ( - "fmt" "sync" "testing" - "github.com/TwiN/go-color" + "github.com/sirupsen/logrus" "github.com/source-academy/stories-backend/internal/config" "gorm.io/gorm" ) @@ -16,10 +15,9 @@ var ( ) func GetTestConf(testEnvPath string) config.Config { - yellowChevron := color.With(color.Yellow, "❯") - fmt.Println(yellowChevron, "Getting test conf") + logrus.Infoln("Reading test configuration...") once.Do(func() { // <-- atomic, does not allow repeating - fmt.Println(yellowChevron, yellowChevron, yellowChevron, "Creating test conf") + logrus.Infoln("Creating test configuration...") testConfig, _ = config.LoadFromEnvironment(testEnvPath) }) return *testConfig