mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: use log.SetDefault instead of log.Root
Signed-off-by: tmelhao <tmelhao@gmail.com>
This commit is contained in:
parent
aadcb88675
commit
7c6424df2b
4 changed files with 11 additions and 15 deletions
|
|
@ -1757,7 +1757,7 @@ func testRepair(t *testing.T, tt *rewindTest, snapshots bool) {
|
||||||
|
|
||||||
func testRepairWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme string) {
|
func testRepairWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme string) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
// fmt.Println(tt.dump(true))
|
// fmt.Println(tt.dump(true))
|
||||||
|
|
||||||
// Create a temporary persistent database
|
// Create a temporary persistent database
|
||||||
|
|
@ -1908,7 +1908,7 @@ func TestIssue23496(t *testing.T) {
|
||||||
|
|
||||||
func testIssue23496(t *testing.T, scheme string) {
|
func testIssue23496(t *testing.T, scheme string) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
//log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
|
|
||||||
// Create a temporary persistent database
|
// Create a temporary persistent database
|
||||||
datadir := t.TempDir()
|
datadir := t.TempDir()
|
||||||
|
|
|
||||||
|
|
@ -1961,7 +1961,7 @@ func testSetHead(t *testing.T, tt *rewindTest, snapshots bool) {
|
||||||
|
|
||||||
func testSetHeadWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme string) {
|
func testSetHeadWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme string) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
// fmt.Println(tt.dump(false))
|
// fmt.Println(tt.dump(false))
|
||||||
|
|
||||||
// Create a temporary persistent database
|
// Create a temporary persistent database
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ type snapshotTest struct {
|
||||||
|
|
||||||
func (snaptest *snapshotTest) test(t *testing.T) {
|
func (snaptest *snapshotTest) test(t *testing.T) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
// fmt.Println(tt.dump())
|
// fmt.Println(tt.dump())
|
||||||
chain, blocks := snaptest.prepare(t)
|
chain, blocks := snaptest.prepare(t)
|
||||||
|
|
||||||
|
|
@ -245,7 +245,7 @@ type crashSnapshotTest struct {
|
||||||
|
|
||||||
func (snaptest *crashSnapshotTest) test(t *testing.T) {
|
func (snaptest *crashSnapshotTest) test(t *testing.T) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
// fmt.Println(tt.dump())
|
// fmt.Println(tt.dump())
|
||||||
chain, blocks := snaptest.prepare(t)
|
chain, blocks := snaptest.prepare(t)
|
||||||
|
|
||||||
|
|
@ -297,7 +297,7 @@ type gappedSnapshotTest struct {
|
||||||
|
|
||||||
func (snaptest *gappedSnapshotTest) test(t *testing.T) {
|
func (snaptest *gappedSnapshotTest) test(t *testing.T) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
// fmt.Println(tt.dump())
|
// fmt.Println(tt.dump())
|
||||||
chain, blocks := snaptest.prepare(t)
|
chain, blocks := snaptest.prepare(t)
|
||||||
|
|
||||||
|
|
@ -341,7 +341,7 @@ type setHeadSnapshotTest struct {
|
||||||
|
|
||||||
func (snaptest *setHeadSnapshotTest) test(t *testing.T) {
|
func (snaptest *setHeadSnapshotTest) test(t *testing.T) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
// fmt.Println(tt.dump())
|
// fmt.Println(tt.dump())
|
||||||
chain, blocks := snaptest.prepare(t)
|
chain, blocks := snaptest.prepare(t)
|
||||||
|
|
||||||
|
|
@ -370,7 +370,7 @@ type wipeCrashSnapshotTest struct {
|
||||||
|
|
||||||
func (snaptest *wipeCrashSnapshotTest) test(t *testing.T) {
|
func (snaptest *wipeCrashSnapshotTest) test(t *testing.T) {
|
||||||
// It's hard to follow the test case, visualize the input
|
// It's hard to follow the test case, visualize the input
|
||||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelTrace, true)))
|
||||||
// fmt.Println(tt.dump())
|
// fmt.Println(tt.dump())
|
||||||
chain, blocks := snaptest.prepare(t)
|
chain, blocks := snaptest.prepare(t)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2234,9 +2234,7 @@ func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommon
|
||||||
// [ Cn, Cn+1, Cc, Sn+3 ... Sm]
|
// [ Cn, Cn+1, Cc, Sn+3 ... Sm]
|
||||||
// ^ ^ ^ pruned
|
// ^ ^ ^ pruned
|
||||||
func TestPrunedImportSide(t *testing.T) {
|
func TestPrunedImportSide(t *testing.T) {
|
||||||
//glogger := log.NewGlogHandler(log.StreamHandler(os.Stdout, log.TerminalFormat(false)))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelDebug, true)))
|
||||||
//glogger.Verbosity(3)
|
|
||||||
//log.Root().SetHandler(log.Handler(glogger))
|
|
||||||
testSideImport(t, 3, 3, -1)
|
testSideImport(t, 3, 3, -1)
|
||||||
testSideImport(t, 3, -3, -1)
|
testSideImport(t, 3, -3, -1)
|
||||||
testSideImport(t, 10, 0, -1)
|
testSideImport(t, 10, 0, -1)
|
||||||
|
|
@ -2245,9 +2243,7 @@ func TestPrunedImportSide(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPrunedImportSideWithMerging(t *testing.T) {
|
func TestPrunedImportSideWithMerging(t *testing.T) {
|
||||||
//glogger := log.NewGlogHandler(log.StreamHandler(os.Stdout, log.TerminalFormat(false)))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelDebug, true)))
|
||||||
//glogger.Verbosity(3)
|
|
||||||
//log.Root().SetHandler(log.Handler(glogger))
|
|
||||||
testSideImport(t, 3, 3, 0)
|
testSideImport(t, 3, 3, 0)
|
||||||
testSideImport(t, 3, -3, 0)
|
testSideImport(t, 3, -3, 0)
|
||||||
testSideImport(t, 10, 0, 0)
|
testSideImport(t, 10, 0, 0)
|
||||||
|
|
@ -3724,7 +3720,7 @@ func TestSetCanonical(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testSetCanonical(t *testing.T, scheme string) {
|
func testSetCanonical(t *testing.T, scheme string) {
|
||||||
//log.Root().SetHandler(log.LvlFilterHandler(log.LvlDebug, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
// log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelDebug, true)))
|
||||||
|
|
||||||
var (
|
var (
|
||||||
key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue