upgrade dependencies

This commit is contained in:
ehlxr 2021-01-04 17:14:30 +08:00
parent 08e6fdbd53
commit a15a40a425
3 changed files with 21 additions and 4 deletions

8
go.mod
View File

@ -4,6 +4,10 @@ go 1.13
require (
github.com/ehlxr/lumberjack v0.0.2-0.20200107093220-2a579f1b2e4d
github.com/robfig/cron/v3 v3.0.0
go.uber.org/zap v1.12.0
github.com/robfig/cron/v3 v3.0.1
go.uber.org/multierr v1.6.0 // indirect
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
)

View File

@ -1,9 +1,10 @@
package log
import (
"go.uber.org/zap"
"testing"
"time"
"go.uber.org/zap"
)
func TestLog(t *testing.T) {
@ -30,6 +31,18 @@ func TestLogWithConfig(t *testing.T) {
// 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) {
lc := NewLogConfig()
lc.MaxSize = 1

View File

@ -1 +1 @@
v0.0.10
v0.0.11