-
Notifications
You must be signed in to change notification settings - Fork 73
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
anvil logs to a tmp file #42
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,8 +98,6 @@ func (s *Supersim) Start(ctx context.Context) error { | |
return fmt.Errorf("supersim failed to get ready: %w", err) | ||
} | ||
|
||
s.EnableLogging() | ||
|
||
s.log.Info("supersim is ready") | ||
s.log.Info(s.ConfigAsString()) | ||
|
||
|
@@ -185,12 +183,6 @@ func (s *Supersim) WaitUntilReady() error { | |
return err | ||
} | ||
|
||
func (s *Supersim) EnableLogging() { | ||
s.IterateChains(func(chain *anvil.Anvil) { | ||
chain.EnableLogging() | ||
}) | ||
} | ||
|
||
func (s *Supersim) IterateChains(fn func(anvil *anvil.Anvil)) { | ||
fn(s.l1Anvil) | ||
|
||
|
@@ -204,11 +196,11 @@ func (s *Supersim) ConfigAsString() string { | |
|
||
fmt.Fprintf(&b, "\nSupersim Config:\n") | ||
fmt.Fprintf(&b, "L1:\n") | ||
fmt.Fprintf(&b, " Chain ID: %d RPC: %s\n", s.l1OpSim.ChainId(), s.l1OpSim.Endpoint()) | ||
fmt.Fprintf(&b, " Chain ID: %d RPC: %s LogPath: %s\n", s.l1OpSim.ChainId(), s.l1OpSim.Endpoint(), s.l1Anvil.LogPath()) | ||
|
||
fmt.Fprintf(&b, "L2:\n") | ||
for _, l2OpSim := range s.l2OpSims { | ||
fmt.Fprintf(&b, " Chain ID: %d RPC: %s\n", l2OpSim.ChainId(), l2OpSim.Endpoint()) | ||
for id, l2OpSim := range s.l2OpSims { | ||
fmt.Fprintf(&b, " Chain ID: %d RPC: %s LogPath: %s\n", l2OpSim.ChainId(), l2OpSim.Endpoint(), s.l2Anvils[id].LogPath()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i doubt this will happen the way everything is setup but i'm wondering if we should add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm given the setup there's no good way to gracefully recover from a programming mistake here so better to simply panic we can add a unit test though that asserts the key is present in both maps when setup. That should cover this case |
||
} | ||
|
||
return b.String() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra
-
at the end?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this was a mistake, will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah wait no actually the extra
-
is there becaseCreateTemp
appends a random string of characters at the end for name collision