Skip to content

Fix json logging redirection predicate #3832

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

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions booster/tools/booster/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ main = do
monadLogger <- askLoggerIO

koreLogEntriesAsJsonSelector <-
case Map.lookup (Logger.LevelOther "SimplifyJson") logLevelToKoreLogEntryMap of
Nothing -> do
Logger.logWarnNS
"proxy"
"Could not find out which Kore log entries correspond to the SimplifyJson level"
pure (const False)
Just es -> pure (`elem` es)
if Logger.LevelOther "SimplifyJson" `elem` customLevels
then case Map.lookup (Logger.LevelOther "SimplifyJson") logLevelToKoreLogEntryMap of
Nothing -> do
Logger.logWarnNS
"proxy"
"Could not find out which Kore log entries correspond to the SimplifyJson level"
pure (const False)
Just koreSimplificationLogEntries -> pure (`elem` koreSimplificationLogEntries)
else pure (const False)

liftIO $ void $ withBugReport (ExeName "kore-rpc-booster") BugReportOnError $ \_reportDirectory -> withMDLib llvmLibraryFile $ \mdl -> do
let coLogLevel = fromMaybe Log.Info $ toSeverity logLevel
Expand Down
16 changes: 9 additions & 7 deletions dev-tools/kore-rpc-dev/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ main = do
monadLogger <- askLoggerIO

koreLogEntriesAsJsonSelector <-
case Map.lookup (Logger.LevelOther "SimplifyJson") logLevelToKoreLogEntryMap of
Nothing -> do
Logger.logWarnNS
"proxy"
"Could not find out which Kore log entries correspond to the SimplifyJson level"
pure (const False)
Just es -> pure (`elem` es)
if Logger.LevelOther "SimplifyJson" `elem` customLevels
then case Map.lookup (Logger.LevelOther "SimplifyJson") logLevelToKoreLogEntryMap of
Nothing -> do
Logger.logWarnNS
"proxy"
"Could not find out which Kore log entries correspond to the SimplifyJson level"
pure (const False)
Just koreSimplificationLogEntries -> pure (`elem` koreSimplificationLogEntries)
else pure (const False)

let coLogLevel = fromMaybe Log.Info $ toSeverity logLevel
koreLogOptions =
Expand Down