github.com/jtzjtz/kit@v1.0.2/log/zap_log_test.go (about)

     1  package log
     2  
     3  import (
     4  	"testing"
     5  	"time"
     6  )
     7  
     8  func initLogInstance() error {
     9  
    10  	return InitLogger("kit", "/Users/jtz/logs", 4, 100)
    11  }
    12  func TestAddlog(t *testing.T) {
    13  	if er := initLogInstance(); er != nil {
    14  		t.Error(er.Error())
    15  	}
    16  	LogInfo(InfoEntity{Msg: "adf", TraceId: "32342342", Env: "testc"}, nil)
    17  
    18  	for {
    19  		//LogInfo(entity.LogInfo{Msg: "adf", TraceId: "32342342", Env: "testc"}, nil)
    20  		LogError(ErrEntity{Msg: "sss"}, nil)
    21  		time.Sleep(time.Second * 10)
    22  	}
    23  
    24  }