shell: Better Logging

This commit is contained in:
Pietro Abate 2019-01-10 11:30:27 +01:00 committed by Grégoire Henry
parent b5499b37d5
commit 5915e98a55
No known key found for this signature in database
GPG Key ID: 50D984F20BD445D2
2 changed files with 8 additions and 6 deletions

View File

@ -261,11 +261,13 @@ module Make (Static: STATIC) (Mempool_worker: Mempool_worker.T)
let encoding =
let open Data_encoding in
list Operation_hash.encoding
let pp ppf os =
Format.fprintf ppf
"@[<v 2>Request:@,%a@]"
(Format.pp_print_list Operation_hash.pp)
os
let pp ppf = function
|[] -> Format.fprintf ppf "@[<v 2>Request:@, Empty List of Operations@]"
|os ->
Format.fprintf ppf
"@[<v 2>Request:@,%a@]"
(Format.pp_print_list Operation_hash.pp)
os
end
module Event = struct

View File

@ -491,7 +491,7 @@ module Make
| Ok () ->
loop ()
| Error [Canceled | Exn Lwt_pipe.Closed | Exn Lwt_dropbox.Closed ] ->
Logger.lwt_log_notice "Worker terminated" >>= fun () ->
Logger.lwt_log_notice "@[Worker terminated [%a] @]" Name.pp w.name >>= fun () ->
do_close None
| Error errs ->
begin match w.current_request with