-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlog_test.go
More file actions
41 lines (33 loc) · 711 Bytes
/
log_test.go
File metadata and controls
41 lines (33 loc) · 711 Bytes
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
38
39
40
41
package log
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestDebug(t *testing.T) {
Init("./test.log", DebugLevel, true)
Debug("test test test")
Debugf("test")
Debugw("test", "a", "b")
Info("test test test")
Infof("test")
Infow("test", "a", "b")
Warn("test test test")
Warnf("test")
Warnw("test", "a", "b")
Error("test test test")
Errorf("test")
Errorw("test", "a", "b")
RequestLogInfow("aa", "bb")
//Panic("test test test")
//Panicf("test")
//Panicw("test", "a", "b")
//
//Fatal("test")
Sync()
}
func TestSetCaller(t *testing.T) {
Init("./test.log", DebugLevel, true, SetCaller(true))
assert.Equal(t, logger.isCaller(DebugLevel), true)
Debug("test")
Sync()
}