Commit 849221ba authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

cannon: Add logging to explain why execution stopped (#9433)

parent 743c9ee4
...@@ -350,6 +350,7 @@ func Run(ctx *cli.Context) error { ...@@ -350,6 +350,7 @@ func Run(ctx *cli.Context) error {
} }
if stopAt(state) { if stopAt(state) {
l.Info("Reached stop at")
break break
} }
...@@ -398,16 +399,20 @@ func Run(ctx *cli.Context) error { ...@@ -398,16 +399,20 @@ func Run(ctx *cli.Context) error {
if preimageRead := state.PreimageOffset > prevPreimageOffset; preimageRead { if preimageRead := state.PreimageOffset > prevPreimageOffset; preimageRead {
if stopAtAnyPreimage { if stopAtAnyPreimage {
l.Info("Stopping at preimage read")
break break
} }
if state.PreimageKey.Bytes()[0] == byte(stopAtPreimageTypeByte) { if state.PreimageKey.Bytes()[0] == byte(stopAtPreimageTypeByte) {
l.Info("Stopping at preimage read", "type", stopAtPreimageTypeByte)
break break
} }
if stopAtPreimageLargerThan != 0 && len(us.LastPreimage()) > stopAtPreimageLargerThan { if stopAtPreimageLargerThan != 0 && len(us.LastPreimage()) > stopAtPreimageLargerThan {
l.Info("Stopping at preimage read", "size", len(us.LastPreimage()), "min", stopAtPreimageLargerThan)
break break
} }
} }
} }
l.Info("Execution stopped", "exited", state.Exited, "code", state.ExitCode)
if err := jsonutil.WriteJSON(ctx.Path(RunOutputFlag.Name), state, OutFilePerm); err != nil { if err := jsonutil.WriteJSON(ctx.Path(RunOutputFlag.Name), state, OutFilePerm); err != nil {
return fmt.Errorf("failed to write state output: %w", err) return fmt.Errorf("failed to write state output: %w", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment