Shell: continue better logging

This commit is contained in:
Grégoire Henry 2019-01-24 13:42:06 +01:00
parent 5915e98a55
commit b5515ea99e
No known key found for this signature in database
GPG Key ID: 50D984F20BD445D2

View File

@ -491,7 +491,9 @@ module Make
| Ok () -> | Ok () ->
loop () loop ()
| Error [Canceled | Exn Lwt_pipe.Closed | Exn Lwt_dropbox.Closed ] -> | Error [Canceled | Exn Lwt_pipe.Closed | Exn Lwt_dropbox.Closed ] ->
Logger.lwt_log_notice "@[Worker terminated [%a] @]" Name.pp w.name >>= fun () -> Logger.lwt_log_notice
"@[Worker terminated [%a] @]"
Name.pp w.name >>= fun () ->
do_close None do_close None
| Error errs -> | Error errs ->
begin match w.current_request with begin match w.current_request with
@ -505,11 +507,14 @@ module Make
| Ok () -> | Ok () ->
loop () loop ()
| Error ([Timeout] as errs) -> | Error ([Timeout] as errs) ->
Logger.lwt_log_notice "Worker terminated with timeout" >>= fun () -> Logger.lwt_log_notice
"@[Worker terminated with timeout [%a] @]"
Name.pp w.name >>= fun () ->
do_close (Some errs) do_close (Some errs)
| Error errs -> | Error errs ->
Logger.lwt_log_error Logger.lwt_log_error
"@[<v 0>Worker crashed:@,%a@]" "@[<v 0>Worker crashed [%a]:@,%a@]"
Name.pp w.name
(Format.pp_print_list Error_monad.pp) errs >>= fun () -> (Format.pp_print_list Error_monad.pp) errs >>= fun () ->
do_close (Some errs) in do_close (Some errs) in
loop () loop ()