Skip to content

Commit 561a538

Browse files
authored
Add [request id] context to relevant proxy log entries (#3975)
Most `[proxy]` log entries are prefixed with `[request ID]`. The exception are are entries that are emitted in-between requests. Before: ``` [proxy] Starting RPC server [proxy] Processing request 0 [proxy] Starting execute request [request 0][booster][execute][depth] 0 steps. ... [proxy] Booster Aborted at Depth {getNat = 0} [proxy] Simplifying booster state and falling back to Kore [proxy] Simplifying execution state ... ``` After: ``` [proxy] Starting RPC server [proxy] Processing request 0 [request 0][proxy] Starting execute request [request 0][booster][execute][depth] 0 steps. ... [request 0][proxy] Booster Aborted at Depth {getNat = 0} [request 0][proxy] Simplifying booster state and falling back to Kore [request 0][proxy] Simplifying execution state ... ```
1 parent 0932411 commit 561a538

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

booster/tools/booster/Server.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,8 @@ main = do
319319

320320
let koreRespond, boosterRespond :: JSONRPC.Id -> Respond (API 'Req) (Booster.Log.LoggerT IO) (API 'Res)
321321
koreRespond reqId = Kore.respond (fromId reqId) kore.serverState (ModuleName kore.mainModule) runSMT
322-
boosterRespond reqId =
323-
Booster.Log.withContextFor reqId
324-
. Booster.Log.withContext CtxBooster
322+
boosterRespond _reqId =
323+
Booster.Log.withContext CtxBooster
325324
. Booster.respond boosterState
326325

327326
proxyConfig =
@@ -339,9 +338,10 @@ main = do
339338
srvSettings
340339
( \rawReq req ->
341340
let reqId = getReqId rawReq
342-
in runBoosterLogger $
341+
in runBoosterLogger $ do
343342
logRequestId reqId
344-
>> Proxy.respondEither proxyConfig (boosterRespond reqId) (koreRespond reqId) req
343+
Booster.Log.withContextFor reqId $
344+
Proxy.respondEither proxyConfig (boosterRespond reqId) (koreRespond reqId) req
345345
)
346346
[ Kore.handleDecidePredicateUnknown
347347
, Booster.handleSmtError

0 commit comments

Comments
 (0)