1
0
mirror of https://github.com/joohoi/acme-dns.git synced 2025-01-12 15:57:51 +07:00
acme-dns/util_test.go

26 lines
559 B
Go
Raw Normal View History

2016-11-28 03:09:13 +07:00
package main
import (
log "github.com/Sirupsen/logrus"
"testing"
)
func TestSetupLogging(t *testing.T) {
for i, test := range []struct {
format string
level string
expected string
}{
{"text", "warning", "warning"},
{"json", "debug", "debug"},
{"text", "info", "info"},
{"json", "error", "error"},
{"text", "something", "warning"},
} {
setupLogging(test.format, test.level)
if log.GetLevel().String() != test.expected {
t.Errorf("Test %d: Expected loglevel %s but got %s", i, test.expected, log.GetLevel().String())
}
}
}