github.com/songzhibin97/gkit@v1.2.13/log/logger_test.go (about)

     1  package log
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  )
     7  
     8  func TestInfo(t *testing.T) {
     9  	logger := DefaultLogger
    10  	logger = With(logger, "ts", DefaultTimestamp, "caller", DefaultCaller)
    11  	_ = logger.Log(LevelInfo, "key1", "value1")
    12  }
    13  
    14  func TestWrapper(t *testing.T) {
    15  	out := NewStdLogger(os.Stdout)
    16  	err := NewStdLogger(os.Stderr)
    17  
    18  	l := With(WithLogs(out, err), "ts", DefaultTimestamp, "caller", DefaultCaller)
    19  	_ = l.Log(LevelInfo, "msg", "test")
    20  }