Skip to content

Commit 5a94184

Browse files
authored
Merge pull request #146 from snabble/default-to-text-in-test
Default to text logging during tests
2 parents 5385298 + 6304dea commit 5a94184

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

helper.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"net/http"
88
"os"
99
"strings"
10+
"testing"
1011
"time"
1112

1213
"github.com/sirupsen/logrus"
@@ -19,7 +20,11 @@ var AccessLogCookiesBlacklist = []string{}
1920
var LifecycleEnvVars = []string{"BUILD_NUMBER", "BUILD_HASH", "BUILD_DATE"}
2021

2122
func init() {
22-
_ = Set("info", false)
23+
if testing.Testing() {
24+
_ = Set("info", true)
25+
} else {
26+
_ = Set("info", false)
27+
}
2328
}
2429

2530
var DefaultLogConfig = LogConfig{

0 commit comments

Comments
 (0)