forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log_test.go
37 lines (32 loc) · 940 Bytes
/
log_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package log
import (
"testing"
)
func TestLogNotInitialized(t *testing.T) {
Info("Test log.Info", " value is ", 10)
Infof("Test log.Infof %d", 10)
Infow("Test log.Infow", "value", 10)
Debugf("Test log.Debugf %d", 10)
Error("Test log.Error", " value is ", 10)
Errorf("Test log.Errorf %d", 10)
Errorw("Test log.Errorw", "value", 10)
Warnf("Test log.Warnf %d", 10)
Warnw("Test log.Warnw", "value", 10)
}
func TestLog(t *testing.T) {
cfg := Config{
Environment: EnvironmentDevelopment,
Level: "debug",
Outputs: []string{"stderr"}, //[]string{"stdout", "test.log"}
}
Init(cfg)
Info("Test log.Info", " value is ", 10)
Infof("Test log.Infof %d", 10)
Infow("Test log.Infow", "value", 10)
Debugf("Test log.Debugf %d", 10)
Error("Test log.Error", " value is ", 10)
Errorf("Test log.Errorf %d", 10)
Errorw("Test log.Errorw", "value", 10)
Warnf("Test log.Warnf %d", 10)
Warnw("Test log.Warnw", "value", 10)
}