mirror of https://github.com/fluffle/goirc
Make mock loggers log everything to avoid stupids.
This commit is contained in:
parent
2f5d4d86a5
commit
97783df463
|
@ -16,6 +16,7 @@ func TestLogCorrectLineNumbers(t *testing.T) {
|
||||||
|
|
||||||
func TestStandardLogging(t *testing.T) {
|
func TestStandardLogging(t *testing.T) {
|
||||||
l, m := NewMock()
|
l, m := NewMock()
|
||||||
|
l.SetLogLevel(Error)
|
||||||
|
|
||||||
l.Log(4, "Nothing should be logged yet")
|
l.Log(4, "Nothing should be logged yet")
|
||||||
m.CheckNothingWritten(t)
|
m.CheckNothingWritten(t)
|
||||||
|
|
|
@ -36,7 +36,8 @@ func NewMock() (*logger, writerMap) {
|
||||||
for lv, w := range wMap {
|
for lv, w := range wMap {
|
||||||
logMap[lv] = makeLogger(w)
|
logMap[lv] = makeLogger(w)
|
||||||
}
|
}
|
||||||
return New(logMap, Error, false), wMap
|
// Set the default log level high enough that everything will get logged
|
||||||
|
return New(logMap, (1 << 31) - 1, false), wMap
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m writerMap) CheckNothingWritten(t *testing.T) {
|
func (m writerMap) CheckNothingWritten(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue