Make mock loggers log everything to avoid stupids.

This commit is contained in:
Alex Bramley 2011-10-27 18:24:08 +01:00
parent 2f5d4d86a5
commit 97783df463
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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) {