aboutsummaryrefslogtreecommitdiffstats
path: root/ethlog/loggers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethlog/loggers_test.go')
-rw-r--r--ethlog/loggers_test.go15
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}