-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger_test.go
More file actions
58 lines (48 loc) · 1.28 KB
/
logger_test.go
File metadata and controls
58 lines (48 loc) · 1.28 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package multi
import (
"testing"
"github.com/microlib/simple"
)
func TestAll(t *testing.T) {
var log = &simple.Logger{Level: "debug"}
t.Run("Logging : should pass", func(t *testing.T) {
log.Info("Testing new logger - this is the old version")
// plainno color
l := NewLogger(PLAIN, TRACE)
l.Info("This is the new version")
l.Info("Log Info")
l.Debug("Log Debug")
l.Trace("Log Trace")
l.Error("Log Error")
l.Warn("Log Warn")
l.Infof("Log Info %s", "test")
l.Debugf("Log Debug %s", "test")
l.Tracef("Log Trace %s", "test")
l.Errorf("Log Error %s", "test")
l.Warnf("Log Warn %s", "test")
// with terminal color
l = NewLogger(COLOR, TRACE)
l.Info("Log Info")
l.Debug("Log Debug")
l.Trace("Log Trace")
l.Error("Log Error")
l.Warn("Log Warn")
l.Infof("Log Info %s", "test")
l.Debugf("Log Debug %s", "test")
l.Tracef("Log Trace %s", "test")
l.Errorf("Log Error %s", "test")
l.Warnf("Log Warn %s", "test")
// with html decoration
l = NewLogger(HTML, TRACE)
l.Info("Log Info")
l.Debug("Log Debug")
l.Trace("Log Trace")
l.Error("Log Error")
l.Warn("Log Warn")
l.Infof("Log Info %s", "test")
l.Debugf("Log Debug %s", "test")
l.Tracef("Log Trace %s", "test")
l.Errorf("Log Error %s", "test")
l.Warnf("Log Warn %s", "test")
})
}