2014-11-21 14:48:49 -06: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-02-04 20:07:58 -06:00
|
|
|
func (testLogger) GetLogLevel() logger.LogLevel { return logger.DebugDetailLevel }
|
2014-11-21 14:48:49 -06:00
|
|
|
func (testLogger) SetLogLevel(logger.LogLevel) {}
|
|
|
|
|
|
|
|
func (l testLogger) LogPrint(level logger.LogLevel, msg string) {
|
|
|
|
l.t.Logf("%s", msg)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (testLogger) detach() {
|
|
|
|
logger.Flush()
|
|
|
|
logger.Reset()
|
|
|
|
}
|