Skip to content

Commit

Permalink
Record a trace event for method calls
Browse files Browse the repository at this point in the history
Makes traces easier to navigate.

Currently only enabled when debug logging is on (ideally it should be
enabled when tracing is on, but OCaml doesn't tell us that).
  • Loading branch information
talex5 committed Nov 30, 2024
1 parent 574768a commit 498a144
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ New features:

API changes:

- Eio port (@talex5 #280 #284 #298 #292 #297 #300).
- Eio port (@talex5 #280 #284 #298 #292 #297 #300 #304).

This switches capnp-rpc from Lwt to Eio.
One particularly nice side effect of this is that `Service.return_lwt` has gone,
Expand Down
5 changes: 4 additions & 1 deletion capnp-rpc/service.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ let local (s:#generic) =
let call = Msg.Request.readable msg in
let interface_id = Call.interface_id_get call in
let method_id = Call.method_id_get call in
Log.debug (fun f -> f "Invoking local method %a" pp_method (interface_id, method_id));
Log.debug (fun f ->
Eio.Private.Trace.log (Fmt.str "%a" pp_method (interface_id, method_id));
f "Invoking local method %a" pp_method (interface_id, method_id)
);
let p = Call.params_get call in
let m : abstract_method_t = s#dispatch ~interface_id ~method_id in
let release_params () = Core_types.Request_payload.release msg in
Expand Down

0 comments on commit 498a144

Please sign in to comment.