Add util_test.go to log test logs
This commit is contained in:
parent
418b638999
commit
43aebf6066
19
internal/util/util_test.go
Normal file
19
internal/util/util_test.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var logBuffer bytes.Buffer
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
log = logrus.StandardLogger()
|
||||
log.Out = &logBuffer
|
||||
log.SetLevel(logrus.DebugLevel)
|
||||
code := m.Run()
|
||||
os.Exit(code)
|
||||
}
|
Loading…
Reference in a new issue