From 97783df463f39d779b925ba3b00a205118335023 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Thu, 27 Oct 2011 18:24:08 +0100 Subject: [PATCH] Make mock loggers log everything to avoid stupids. --- logging/log_test.go | 1 + logging/mock.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/logging/log_test.go b/logging/log_test.go index 35868ed..bc44995 100644 --- a/logging/log_test.go +++ b/logging/log_test.go @@ -16,6 +16,7 @@ func TestLogCorrectLineNumbers(t *testing.T) { func TestStandardLogging(t *testing.T) { l, m := NewMock() + l.SetLogLevel(Error) l.Log(4, "Nothing should be logged yet") m.CheckNothingWritten(t) diff --git a/logging/mock.go b/logging/mock.go index 380b536..a335b1a 100644 --- a/logging/mock.go +++ b/logging/mock.go @@ -36,7 +36,8 @@ func NewMock() (*logger, writerMap) { for lv, w := range wMap { 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) {