diff options
author | Felix Lange <fjl@twurst.com> | 2014-11-22 04:48:49 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2014-11-22 04:52:45 +0800 |
commit | 59b63caf5e4de64ceb7dcdf01551a080f53b1672 (patch) | |
tree | a4e79590284c5afe4d6927b422a5092b074e7938 /p2p/testlog_test.go | |
parent | e4a601c6444afdc11ce0cb80d7fd83116de2c8b9 (diff) | |
download | dexon-59b63caf5e4de64ceb7dcdf01551a080f53b1672.tar dexon-59b63caf5e4de64ceb7dcdf01551a080f53b1672.tar.gz dexon-59b63caf5e4de64ceb7dcdf01551a080f53b1672.tar.bz2 dexon-59b63caf5e4de64ceb7dcdf01551a080f53b1672.tar.lz dexon-59b63caf5e4de64ceb7dcdf01551a080f53b1672.tar.xz dexon-59b63caf5e4de64ceb7dcdf01551a080f53b1672.tar.zst dexon-59b63caf5e4de64ceb7dcdf01551a080f53b1672.zip |
p2p: API cleanup and PoC 7 compatibility
Whoa, one more big commit. I didn't manage to untangle the
changes while working towards compatibility.
Diffstat (limited to 'p2p/testlog_test.go')
-rw-r--r-- | p2p/testlog_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/p2p/testlog_test.go b/p2p/testlog_test.go new file mode 100644 index 000000000..951d43243 --- /dev/null +++ b/p2p/testlog_test.go @@ -0,0 +1,28 @@ +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 +} + +func (testLogger) GetLogLevel() logger.LogLevel { return logger.DebugLevel } +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() +} |