Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support testmempoolaccept for both bitcoind and btcd #2053

Merged
merged 11 commits into from
Jan 16, 2024
Prev Previous commit
Next Next commit
integration: print logs to console
  • Loading branch information
yyforyongyu committed Jan 15, 2024
commit 8817ebdd3947c052acf98e2f032cc14e92f16e21
26 changes: 26 additions & 0 deletions integration/log.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//go:build rpctest
// +build rpctest

package integration

import (
"os"

"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btclog"
)

type logWriter struct{}

func (logWriter) Write(p []byte) (n int, err error) {
os.Stdout.Write(p)
return len(p), nil
}

func init() {
backendLog := btclog.NewBackend(logWriter{})
testLog := backendLog.Logger("ITEST")
testLog.SetLevel(btclog.LevelDebug)

rpcclient.UseLogger(testLog)
}