gologger/main_test.go

27 lines
497 B
Go
Raw Permalink Normal View History

// TestGetLogger tests the GetLogger function
package gologger
import "testing"
func TestGetLogger(t *testing.T) {
// Initialize loggerMap and loggerConfig
dl := GetLogger("default")
if dl != defaultLogger {
t.Errorf("GetLogger(\"defult\") should return defaultLogger")
}
al := GetLogger("app")
if al == dl {
t.Errorf("GetLogger(\"app\") should return a new logger")
}
al2 := GetLogger("app")
if al2 != al {
t.Errorf("GetLogger(\"app\") should return the same logger")
}
}