ocaml-cohttp icon indicating copy to clipboard operation
ocaml-cohttp copied to clipboard

`cohttp/client.ml` logs on the default source `application`

Open arvidj opened this issue 10 months ago • 0 comments

Unless I'm mistaken, client.ml logs on the default source application here:

https://github.com/mirage/ocaml-cohttp/blob/master/cohttp/src/client.ml#L78

I'm seeing messages like

2025-02-05T12:15:03-00:00 [INFO] <application> POST http://127.0.0.1:8200/

in my logs that seem to stem from this line. I've setup my log reporter to show the source between the angle brackets in order to find the origin of this message. I'd like to filter out these messages, but since the default source is used, I can't. I am using cohttp-eio and perhaps the issue is rather there. Naively, the solution seems to be to add something like

let src = Logs.Src.create "cohttp.client" ~doc:"Cohttp Client"

module Logs = (val Logs.src_log src)

to client.ml.

arvidj avatar Feb 05 '25 12:02 arvidj