diff options
author | zelig <viktor.tron@gmail.com> | 2014-07-15 01:37:01 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-07-15 01:37:01 +0800 |
commit | 5c03adbdededd31cb73f64ced01e33154347e193 (patch) | |
tree | 72b43f8f97596e7e871c0b865d446d0d90c5483a /ethlog/loggers_test.go | |
parent | 4d77b7facecfea7069af15f19429585687c47fbb (diff) | |
download | dexon-5c03adbdededd31cb73f64ced01e33154347e193.tar dexon-5c03adbdededd31cb73f64ced01e33154347e193.tar.gz dexon-5c03adbdededd31cb73f64ced01e33154347e193.tar.bz2 dexon-5c03adbdededd31cb73f64ced01e33154347e193.tar.lz dexon-5c03adbdededd31cb73f64ced01e33154347e193.tar.xz dexon-5c03adbdededd31cb73f64ced01e33154347e193.tar.zst dexon-5c03adbdededd31cb73f64ced01e33154347e193.zip |
fix logger channel blocking
Diffstat (limited to 'ethlog/loggers_test.go')
-rw-r--r-- | ethlog/loggers_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
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} |