Skip to content

Commit

Permalink
Only emit proxy branch-eliminating rewrite trace when asked (#3976)
Browse files Browse the repository at this point in the history
Follow-up to #3974
  • Loading branch information
geo2a authored Jul 12, 2024
1 parent 95d7d59 commit d137af6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions booster/tools/booster/Proxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -642,22 +642,25 @@ respondEither cfg@ProxyConfig{boosterState} booster kore req = case req of
-- extract the rule-id information from the result we proceed with
let onlyNext = head filteredNexts
rewriteRuleId = fromMaybe "UNKNOWN" onlyNext.ruleId
proxyRewriteStepLog =
RPCLog.Rewrite
{ result =
RPCLog.Success
{ rewrittenTerm = Nothing
, substitution = Nothing
, ruleId = rewriteRuleId
proxyRewriteStepLogs
| Just True <- logSettings.logSuccessfulRewrites =
Just . (: []) $
RPCLog.Rewrite
{ result =
RPCLog.Success
{ rewrittenTerm = Nothing
, substitution = Nothing
, ruleId = rewriteRuleId
}
, origin = RPCLog.Proxy
}
, origin = RPCLog.Proxy
}
| otherwise = Nothing
Booster.Log.withContext CtxProxy $
Booster.Log.logMessage' ("Continuing after rewriting with rule " <> rewriteRuleId)
pure $
Left
( execStateToKoreJson onlyNext
, logsOnly <> filteredNextLogs <> [Just [proxyRewriteStepLog]]
, logsOnly <> filteredNextLogs <> [proxyRewriteStepLogs]
)
-- otherwise falling through to _otherReason
CutPointRule
Expand Down

0 comments on commit d137af6

Please sign in to comment.