diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-05 23:27:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-05 23:27:48 +0800 |
commit | f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8 (patch) | |
tree | ff9a9a91fd5322f09c600432a47000afb27738e6 /p2p/testlog_test.go | |
parent | 9925916851c00323336e213fc18c83da5fceee94 (diff) | |
parent | 195b2d2ebdfe1e794c096c9b6c9fe91e9df7af1d (diff) | |
download | go-tangerine-f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8.tar go-tangerine-f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8.tar.gz go-tangerine-f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8.tar.bz2 go-tangerine-f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8.tar.lz go-tangerine-f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8.tar.xz go-tangerine-f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8.tar.zst go-tangerine-f06543fd066e11ac5c36f3eba4f1f82a7a1aefb8.zip |
Merge branch 'poc8' into develop
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() +} |