From 62a891e7f6801ac65523ad224c624627b7400c4d Mon Sep 17 00:00:00 2001 From: "R. Aidan Campbell" Date: Sun, 10 Oct 2021 17:20:53 -0700 Subject: [PATCH] setting log level for tests now uses logrus' exported type instead of the string value, to guarantee error isn't possible --- internal/media/util_test.go | 3 ++- testrig/log.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/media/util_test.go b/internal/media/util_test.go index 59a7b62ff..c54fb6f2c 100644 --- a/internal/media/util_test.go +++ b/internal/media/util_test.go @@ -19,6 +19,7 @@ package media import ( + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/log" "io/ioutil" "testing" @@ -37,7 +38,7 @@ type MediaUtilTestSuite struct { // SetupSuite sets some variables on the suite that we can use as consts (more or less) throughout func (suite *MediaUtilTestSuite) SetupSuite() { // doesn't use testrig.InitTestLog() helper to prevent import cycle - err := log.Initialize("trace") + err := log.Initialize(logrus.TraceLevel.String()) if err != nil { panic(err) } diff --git a/testrig/log.go b/testrig/log.go index 374a3db79..5db12e6e9 100644 --- a/testrig/log.go +++ b/testrig/log.go @@ -19,12 +19,13 @@ package testrig import ( + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/log" ) // InitTestLog sets the global logger to trace level for logging func InitTestLog() { - err := log.Initialize("trace") + err := log.Initialize(logrus.TraceLevel.String()) if err != nil { panic(err) }