update log

This commit is contained in:
2023-03-14 13:53:07 +08:00
parent 3679bd502c
commit 811504c5d5
4 changed files with 56 additions and 32 deletions

View File

@@ -19,3 +19,22 @@ func TestLog(t *testing.T) {
Warnf("time: %s", time.Now())
Errorf("time: %s", time.Now())
}
func TestLogFile(t *testing.T) {
config := DefaultConfig
config.NeedLogFile = false
config.LogFilePath = "logs"
Init("debug", config)
Debug("time: ", time.Now())
Info("time: ", time.Now())
Warn("time: ", time.Now())
Error("time: ", time.Now())
fmt.Println()
Debugf("time: %s", time.Now())
Infof("time: %s", time.Now())
Warnf("time: %s", time.Now())
Errorf("time: %s", time.Now())
}