Initial commit

This commit is contained in:
Cruise Zhao
2020-04-06 19:57:19 +08:00
commit 2fc86fd0a1
42 changed files with 4056 additions and 0 deletions

30
tlog/tlog_test.go Normal file
View File

@@ -0,0 +1,30 @@
package tlog
import (
"testing"
"time"
)
func TestTlog(t *testing.T) {
Init(Config{
FileSize: 128,
FileNum: 5,
FileName: "test",
Level: "DEBUG",
Dir: "./logs",
Tag: "test",
//Debug: true,
//SentryUrl: "http://d25c96785a184d6f8d051712a209a3a8:7f4a22c48897423caa9a0aec6bb93416@172.20.0.84:9000/5",
UseSyslog: true,
SyslogTag: "test",
})
for i := 0; i < 10; i++ {
Info("xxxxxxxxxxasfsadjflasjfdlasjdfsajdfsadfjasjfdafjsfsa")
Infof("%s", "xxxxxxxxxxasfsadjflasjfdlasjdfsajdfsadfjasjfdafjsfsa")
InfoJson(map[string]interface{}{"test": time.Now().UnixNano()})
Error("xxxxxxxxxxasfsadjflasjfdlasjdfsajdfsadfjasjfdafjsfsa")
Errorf("%s", "xxxxxxxxxxasfsadjflasjfdlasjdfsajdfsadfjasjfdafjsfsa")
ErrorJson(map[string]interface{}{"test": time.Now().UnixNano()})
}
time.Sleep(1 * time.Second)
}