mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
fix example test case
This commit is contained in:
parent
dc5cd6e350
commit
8f1a56bb4e
1 changed files with 3 additions and 8 deletions
|
|
@ -1,8 +1,9 @@
|
|||
package testlog
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
|
||||
func TestLogging(t *testing.T) {
|
||||
|
|
@ -10,12 +11,6 @@ func TestLogging(t *testing.T) {
|
|||
subLogger := l.New("foobar", 123)
|
||||
|
||||
l.Info("Visible")
|
||||
subLogger.Info("Hide and seek") // not visible due to sub buffer never being flushed
|
||||
subLogger.Info("Hide and seek") // this log is erroneously hidden in master, but fixed with this PR
|
||||
l.Info("Also visible")
|
||||
|
||||
t.Log("flushed: ", l.Handler().(*bufHandler).buf)
|
||||
t.Log("remaining: ", subLogger.Handler().(*bufHandler).buf)
|
||||
// horrible hack to manually bring back the expected log data
|
||||
l.Handler().(*bufHandler).buf = subLogger.Handler().(*bufHandler).buf
|
||||
l.(*logger).flush()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue