grlogs/log_test.go

20 lines
434 B
Go
Raw Normal View History

2020-04-01 11:38:28 +08:00
package grlogs
import (
2020-04-28 14:32:56 +08:00
_ "golib.gaore.com/GaoreGo/grlogs/logs/es"
2020-04-01 11:38:28 +08:00
"testing"
"time"
2020-04-01 11:38:28 +08:00
)
func TestGetLogger(t *testing.T) {
2020-04-28 14:32:56 +08:00
l := Get("nds", 128).SetAdapter(LevelAll, AdapterElasticSearch)
l.Debug("我正在调试")
l.Critical("出错了")
Get("nds").Warning("hadoee %s", time.Now().Format(time.RFC1123))
2020-04-28 15:27:39 +08:00
Get("wifi").SetAdapter(LevelAll, AdapterElasticSearch)
for i := 0; i < 10; i++ {
Get("wifi").Error("neoweiwoewe")
}
2020-04-01 11:38:28 +08:00
}