mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 05:46:15 -06:00
setting log level for tests now uses logrus' exported type instead of the string value, to guarantee error isn't possible
This commit is contained in:
parent
e840aacc21
commit
62a891e7f6
2 changed files with 4 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue