From 5c03adbdededd31cb73f64ced01e33154347e193 Mon Sep 17 00:00:00 2001 From: zelig Date: Mon, 14 Jul 2014 18:37:01 +0100 Subject: fix logger channel blocking --- ethlog/loggers_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ethlog/loggers_test.go') diff --git a/ethlog/loggers_test.go b/ethlog/loggers_test.go index 9fff471c1..0e1c12e55 100644 --- a/ethlog/loggers_test.go +++ b/ethlog/loggers_test.go @@ -28,6 +28,21 @@ func (t *TestLogSystem) GetLogLevel() LogLevel { return t.level } +func TestLoggerFlush(t *testing.T) { + logger := NewLogger("TEST") + testLogSystem := &TestLogSystem{level: WarnLevel} + AddLogSystem(testLogSystem) + for i := 0; i < 5; i++ { + logger.Errorf(".") + } + Flush() + Reset() + output := testLogSystem.Output + if output != "[TEST] .[TEST] .[TEST] .[TEST] .[TEST] ." { + t.Error("Expected complete logger output '[TEST] .[TEST] .[TEST] .[TEST] .[TEST] .', got ", output) + } +} + func TestLoggerPrintln(t *testing.T) { logger := NewLogger("TEST") testLogSystem := &TestLogSystem{level: WarnLevel} -- cgit