Skip to content

Commit

Permalink
Capture root logger output in e2e tests
Browse files Browse the repository at this point in the history
This [would have helped us] find the reorg error much faster.

[would have helped us]: ethereum-optimism/optimism#11756
  • Loading branch information
joshklop committed Sep 8, 2024
1 parent e79afef commit 1873683
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions e2e/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func TestE2E(t *testing.T) {
require.NoError(t, env.Close())
}()

// Unfortunately, geth and parts of the OP Stack occasionally use the root logger.
// We capture the root logger's output in a separate file.
log.SetDefault(log.NewLogger(log.NewTerminalHandler(openLogFile(t, env, "root-logger"), false)))

if err := os.Mkdir(artifactsDirectoryName, 0o755); !errors.Is(err, os.ErrExist) {
require.NoError(t, err)
}
Expand Down

0 comments on commit 1873683

Please sign in to comment.