Skip to content

Commit 50f4a48

Browse files
geo2arv-jenkins
andauthored
Add -l EquationWarnings and warning context in Booster (#3937)
Fixes #3927 This PR disables the display of the three equation-related warning in Booster by default. They can be re-enabled by the flag `-l EquationWarnings`, which is a shorthand to the context expression `--log-context booster>(simplification *|function *)>warning`. --------- Co-authored-by: rv-jenkins <[email protected]>
1 parent e8a623f commit 50f4a48

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

booster/library/Booster/CLOptions.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ allowedLogLevels =
232232
, ("Depth", "Log the current depth of the state")
233233
, ("SMT", "Log the SMT-solver interactions")
234234
, ("ErrorDetails", "Log error conditions with extensive details")
235+
,
236+
( "EquationWarnings"
237+
, "Log warnings indicating soft-violations of conditions, i.e. exceeding the equation recursion/iteration limit "
238+
)
235239
]
236240

237241
levelToContext :: Map Text [ContextFilter]
@@ -279,6 +283,12 @@ levelToContext =
279283
, [ctxt| booster>failure,abort |]
280284
]
281285
)
286+
,
287+
( "EquationWarnings"
288+
,
289+
[ [ctxt| booster>(simplification *|function *)>warning |]
290+
]
291+
)
282292
]
283293

284294
-- Partition provided log levels into standard and custom ones, and

booster/library/Booster/Pattern/ApplyEquations.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ fromCache tag t = eqState $ Map.lookup t <$> gets (select tag . (.cache))
232232

233233
logWarn :: LoggerMIO m => Text -> m ()
234234
logWarn msg =
235-
logMessage' $
236-
msg <> " For more details, enable full context logging '--log-context \"*\"'"
235+
withContext "warning" $
236+
logMessage msg
237237

238238
checkForLoop :: LoggerMIO io => Term -> EquationT io ()
239239
checkForLoop t = do

0 commit comments

Comments
 (0)