This commit is contained in:
Liang Ding 2014-12-21 10:33:27 +08:00
parent 75353f5e70
commit a9326e876b
1 changed files with 57 additions and 0 deletions

View File

@ -40,3 +40,60 @@ func TestInfo(t *testing.T) {
func TestInfof(t *testing.T) {
logger.Infof("infof")
}
func TestWarn(t *testing.T) {
logger.Warn("warn")
}
func TestWarnf(t *testing.T) {
logger.Warnf("warnf")
}
func TestError(t *testing.T) {
logger.Error("error")
}
func TestErrorf(t *testing.T) {
logger.Errorf("errorf")
}
func TestGetLevel(t *testing.T) {
l := getLevel("info")
logger.Info(l)
}
func TestLoggerSetLevel(t *testing.T) {
if logger.level != Trace {
t.FailNow()
return
}
logger.SetLevel("info")
if logger.level != Info {
t.FailNow()
return
}
}
func TestIsTraceEnabled(t *testing.T) {
logger.SetLevel("trace")
if !logger.IsTraceEnabled() {
t.FailNow()
return
}
}
func TestIsDebugEnabled(t *testing.T) {
logger.SetLevel("debug")
if !logger.IsDebugEnabled() {
t.FailNow()
return
}
}