Skip to content

Commit 0f5549c

Browse files
committed
Don't output Kore's JSON logs in Proxy.hs
1 parent cf60a59 commit 0f5549c

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

booster/tools/booster/Proxy.hs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,7 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
110110
ImpliesM
111111
( Implies
112112
impliesReq
113-
{ ImpliesRequest.logSuccessfulSimplifications =
114-
Just $ Log.LevelOther "SimplifyJson" `elem` cfg.customLogLevels
115-
}
116113
)
117-
case koreResult of
118-
Right (Implies koreRes) -> do
119-
-- Kore may have produced simplification logs during rewriting. If so,
120-
-- output them Kore at "SimplifyJson" level. Erase terms from the traces.
121-
when (isJust koreRes.logs) $ do
122-
outputLogsAtLevel (Log.LevelOther "SimplifyJson")
123-
. map RPCLog.logEntryEraseTerms
124-
. fromJust
125-
$ koreRes.logs
126-
_ -> pure ()
127114
pure koreResult
128115
Simplify simplifyReq ->
129116
liftIO (getTime Monotonic) >>= handleSimplify simplifyReq . Just
@@ -175,8 +162,6 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
175162
Simplify
176163
simplifyReq
177164
{ SimplifyRequest.state = boosterRes.state
178-
, SimplifyRequest.logSuccessfulSimplifications =
179-
Just $ Log.LevelOther "SimplifyJson" `elem` cfg.customLogLevels
180165
}
181166
(koreResult, koreTime) <- Stats.timed $ kore koreReq
182167
case koreResult of
@@ -194,13 +179,6 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
194179
diffBy def boosterRes.state.term koreRes.state.term
195180
in Text.pack ("Kore simplification: Diff (< before - > after)\n" <> diff)
196181
stop <- liftIO $ getTime Monotonic
197-
-- output simplification traces returned by Kore at "SimplifyJson" level, effectively
198-
-- appending them to Booster's traces. Erase terms from the traces.
199-
when (isJust koreRes.logs) $ do
200-
outputLogsAtLevel (Log.LevelOther "SimplifyJson")
201-
. map RPCLog.logEntryEraseTerms
202-
. fromJust
203-
$ koreRes.logs
204182
let timing
205183
| Just start <- mbStart
206184
, fromMaybe False simplifyReq.logTiming =
@@ -369,8 +347,6 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
369347
{ state = execStateToKoreJson simplifiedBoosterState
370348
, maxDepth = Just $ Depth 1
371349
, assumeStateDefined = Just True
372-
, ExecuteRequest.logSuccessfulSimplifications =
373-
Just $ Log.LevelOther "SimplifyJson" `elem` cfg.customLogLevels
374350
}
375351
)
376352
when (isJust statsVar) $ do
@@ -416,16 +392,6 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
416392
Log.logOtherNS "proxy" (Log.LevelOther "Aborts") $
417393
"kore confirms result " <> Text.pack (show bRes)
418394

419-
-- Kore may have produced simplification logs during rewriting. If so,
420-
-- output them Kore at "SimplifyJson" level, effectively
421-
-- appending them to Booster's traces. Erase terms from the traces.
422-
when (isJust koreResult.logs) $ do
423-
outputLogsAtLevel (Log.LevelOther "SimplifyJson")
424-
. map RPCLog.logEntryEraseTerms
425-
. filter isSimplificationLogEntry
426-
. fromJust
427-
$ koreResult.logs
428-
429395
case koreResult.reason of
430396
DepthBound -> do
431397
-- if we made one step, add the number of
@@ -644,15 +610,6 @@ combineLogs logSources
644610
| all isNothing logSources = Nothing
645611
| otherwise = Just $ concat $ catMaybes logSources
646612

647-
-- | Log a list of RPCLog items at a certain level
648-
outputLogsAtLevel :: Log.MonadLogger m => Log.LogLevel -> [RPCLog.LogEntry] -> m ()
649-
outputLogsAtLevel level = mapM_ (Log.logOtherNS "proxy" level . RPCLog.encodeLogEntryText)
650-
651-
isSimplificationLogEntry :: RPCLog.LogEntry -> Bool
652-
isSimplificationLogEntry = \case
653-
RPCLog.Simplification{} -> True
654-
_ -> False
655-
656613
makeVacuous :: Maybe [RPCLog.LogEntry] -> ExecuteResult -> ExecuteResult
657614
makeVacuous newLogs execState =
658615
execState

0 commit comments

Comments
 (0)