diff --git a/log.go b/log.go index de68f00..8ee254d 100644 --- a/log.go +++ b/log.go @@ -73,6 +73,19 @@ func GetEs(label string, channelLens ...int64) (l *Logger) { return } +func GetAli(label string, channelLens ...int64) (l *Logger) { + var filelevel Level = LevelInfo + var loaded bool + if os.Getenv(envkey) == "dev" { + filelevel = LevelAll + } + + if l, loaded = New(label, channelLens...); !loaded { + l.SetAdapter(LevelAll, AdapterConsole).SetAdapter(filelevel, AdapterAliLs) + } + return +} + func Close(lable string) { if v, ok := loggers.Load(lable); ok { if tmp, ok := v.(*Logger); ok { diff --git a/log_test.go b/log_test.go index fc0a0b4..7c285b0 100644 --- a/log_test.go +++ b/log_test.go @@ -34,7 +34,7 @@ func TestGetLogger(t *testing.T) { func TestGetAliLs(t *testing.T) { - l := Get("test_alils").SetAdapter(LevelAll, AdapterAliLs) + l := GetAli("test_alils") for i := 0; i < 1; i++ { l.Info("endport")