2014-11-21 22:48:49 +02:00
|
|
|
package p2p
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/logger"
|
|
|
|
)
|
|
|
|
|
|
|
|
type testLogger struct{ t *testing.T }
|
|
|
|
|
|
|
|
func testlog(t *testing.T) testLogger {
|
|
|
|
logger.Reset()
|
|
|
|
l := testLogger{t}
|
|
|
|
logger.AddLogSystem(l)
|
|
|
|
return l
|
|
|
|
}
|
|
|
|
|
2015-03-23 18:41:41 +02:00
|
|
|
func (l testLogger) LogPrint(msg logger.LogMsg) {
|
|
|
|
l.t.Logf("%s", msg.String())
|
2014-11-21 22:48:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (testLogger) detach() {
|
|
|
|
logger.Flush()
|
|
|
|
logger.Reset()
|
|
|
|
}
|