2020-04-01 11:38:28 +08:00
|
|
|
package grlogs
|
|
|
|
|
|
|
|
import (
|
2020-04-27 21:26:13 +08:00
|
|
|
_ "golib.gaore.com/GaoreGo/grlogs/logs/es"
|
2020-04-01 11:38:28 +08:00
|
|
|
"testing"
|
2020-04-27 21:26:13 +08:00
|
|
|
"time"
|
2020-04-01 11:38:28 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetLogger(t *testing.T) {
|
2020-04-27 21:26:13 +08:00
|
|
|
l := Get("nds", 128).SetAdapter(LevelNone, AdapterElasticSearch)
|
2020-04-24 17:34:39 +08:00
|
|
|
l.Debug("我正在调试")
|
|
|
|
l.Critical("出错了")
|
2020-04-27 21:26:13 +08:00
|
|
|
Get("nds").Warning("hadoee %s", time.Now().Format(time.RFC1123))
|
|
|
|
l.Flush()
|
2020-04-01 11:38:28 +08:00
|
|
|
}
|