Compare commits
No commits in common. "master" and "v0.0.10" have entirely different histories.
8
go.mod
8
go.mod
|
@ -4,10 +4,6 @@ go 1.13
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/ehlxr/lumberjack v0.0.2-0.20200107093220-2a579f1b2e4d
|
github.com/ehlxr/lumberjack v0.0.2-0.20200107093220-2a579f1b2e4d
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.0
|
||||||
go.uber.org/multierr v1.6.0 // indirect
|
go.uber.org/zap v1.12.0
|
||||||
go.uber.org/zap v1.16.0
|
|
||||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
|
|
||||||
golang.org/x/tools v0.0.0-20210104081019-d8d6ddbec6ee // indirect
|
|
||||||
honnef.co/go/tools v0.1.0 // indirect
|
|
||||||
)
|
)
|
||||||
|
|
15
log_test.go
15
log_test.go
|
@ -1,10 +1,9 @@
|
||||||
package log
|
package log
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"go.uber.org/zap"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLog(t *testing.T) {
|
func TestLog(t *testing.T) {
|
||||||
|
@ -31,18 +30,6 @@ func TestLogWithConfig(t *testing.T) {
|
||||||
// Panicf("this is %s message", "panic")
|
// Panicf("this is %s message", "panic")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLogWithNew(t *testing.T) {
|
|
||||||
config := NewLogConfig()
|
|
||||||
_ = config.Level.Set("debug")
|
|
||||||
config.Name = "main"
|
|
||||||
|
|
||||||
logger := config.New()
|
|
||||||
|
|
||||||
log := With(logger, "traceid", float64(21221212122), "request", "[POST]/hello/v2")
|
|
||||||
log.Debugf("this is %s message", "debug")
|
|
||||||
log.Infof("this is %s message", "info")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestLogRote(t *testing.T) {
|
func TestLogRote(t *testing.T) {
|
||||||
lc := NewLogConfig()
|
lc := NewLogConfig()
|
||||||
lc.MaxSize = 1
|
lc.MaxSize = 1
|
||||||
|
|
Loading…
Reference in New Issue