Skip to content

Commit 499d16f

Browse files
committed
fix plain format breakage found in review
1 parent 0a08364 commit 499d16f

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

web.ml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,17 @@ module Http (IO : IO_TYPE) (Curl_IO : CURL with type 'a t = 'a IO.t) : HTTP with
358358
| Some (`Raw (ct,body)) -> sprintf "%s \"%s\"" ct (Stre.shorten ~escape:true 64 body)
359359
| Some (`Chunked (ct,_f)) -> sprintf "%s chunked" ct
360360
in
361-
let pairs = [
362-
"method", action_name;
363-
"http_seq", string_of_int nr_http;
364-
"url", url;
365-
] in
366-
let pairs = if body = "" then pairs else ("body", body) :: pairs in
367-
log #info ~pairs "http start"
361+
362+
match Log.State.get_cur_format () with
363+
| `Plain, _ -> log #info "%s #%d %s %s" action_name nr_http url body
364+
| `Logfmt, _ ->
365+
let pairs = [
366+
"method", action_name;
367+
"http_seq", string_of_int nr_http;
368+
"url", url;
369+
] in
370+
let pairs = if body = "" then pairs else ("body", body) :: pairs in
371+
log #info ~pairs "http start"
368372
end;
369373

370374
let describe () =

0 commit comments

Comments
 (0)