Skip to content

Commit b93a726

Browse files
committed
*test*: use logrus instead of std log
1 parent 8f1e6bb commit b93a726

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

pkg/test/context.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
package test
1616

1717
import (
18-
"log"
1918
"strconv"
2019
"strings"
2120
"testing"
2221
"time"
22+
23+
log "github.com/sirupsen/logrus"
2324
)
2425

2526
type TestCtx struct {
@@ -69,7 +70,7 @@ func (ctx *TestCtx) Cleanup() {
6970
for i := len(ctx.cleanupFns) - 1; i >= 0; i-- {
7071
err := ctx.cleanupFns[i]()
7172
if err != nil {
72-
ctx.t.Errorf("a cleanup function failed with error: %v\n", err)
73+
ctx.t.Errorf("a cleanup function failed with error: (%v)\n", err)
7374
}
7475
}
7576
}
@@ -82,7 +83,7 @@ func (ctx *TestCtx) CleanupNoT() {
8283
err := ctx.cleanupFns[i]()
8384
if err != nil {
8485
failed = true
85-
log.Printf("a cleanup function failed with error: %v\n", err)
86+
log.Errorf("a cleanup function failed with error: (%v)", err)
8687
}
8788
}
8889
if failed {

pkg/test/main_entry.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ package test
1717
import (
1818
"flag"
1919
"io/ioutil"
20-
"log"
2120
"os"
2221
"testing"
22+
23+
log "github.com/sirupsen/logrus"
2324
)
2425

2526
const (

test/e2e/framework/framework.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
goctx "context"
1919
"flag"
2020
"fmt"
21-
"log"
2221
"os"
2322
"sync"
2423
"time"
2524

25+
log "github.com/sirupsen/logrus"
2626
extscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
2727
"k8s.io/apimachinery/pkg/runtime"
2828
"k8s.io/apimachinery/pkg/runtime/serializer"

test/e2e/framework/main_entry.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
package framework
1616

1717
import (
18-
"log"
1918
"os"
2019
"testing"
20+
21+
log "github.com/sirupsen/logrus"
2122
)
2223

2324
func MainEntry(m *testing.M) {
2425
if err := setup(); err != nil {
25-
log.Fatalf("failed to set up framework: %v", err)
26+
log.Fatalf("failed to set up framework: (%v)", err)
2627
}
2728

2829
os.Exit(m.Run())

0 commit comments

Comments
 (0)