From df34917342c2dac521c320ad2ff6bcca2b1f9d7b Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Thu, 9 Aug 2018 21:31:22 -0700 Subject: [PATCH] [infer] print all the severities in the debug html Reviewed By: mbouaziz Differential Revision: D9252923 fbshipit-source-id: ded66710c --- infer/src/IR/Errlog.ml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/infer/src/IR/Errlog.ml b/infer/src/IR/Errlog.ml index ab712d246..83741487c 100644 --- a/infer/src/IR/Errlog.ml +++ b/infer/src/IR/Errlog.ml @@ -188,18 +188,15 @@ let pp_html source path_to_root fmt (errlog: t) = F.fprintf fmt "
%a %a %a" IssueType.pp key.err_name Localise.pp_error_desc key.err_desc pp_eds err_datas in - F.fprintf fmt "%aERRORS DURING FOOTPRINT@\n" Io_infer.Html.pp_hline () ; - ErrLogHash.iter (pp_err_log true Exceptions.Error) errlog ; - F.fprintf fmt "%aERRORS DURING RE-EXECUTION@\n" Io_infer.Html.pp_hline () ; - ErrLogHash.iter (pp_err_log false Exceptions.Error) errlog ; - F.fprintf fmt "%aWARNINGS DURING FOOTPRINT@\n" Io_infer.Html.pp_hline () ; - ErrLogHash.iter (pp_err_log true Exceptions.Warning) errlog ; - F.fprintf fmt "%aWARNINGS DURING RE-EXECUTION@\n" Io_infer.Html.pp_hline () ; - ErrLogHash.iter (pp_err_log false Exceptions.Warning) errlog ; - F.fprintf fmt "%aINFOS DURING FOOTPRINT@\n" Io_infer.Html.pp_hline () ; - ErrLogHash.iter (pp_err_log true Exceptions.Info) errlog ; - F.fprintf fmt "%aINFOS DURING RE-EXECUTION@\n" Io_infer.Html.pp_hline () ; - ErrLogHash.iter (pp_err_log false Exceptions.Info) errlog + let pp severity is_footprint phase = + F.fprintf fmt "%a%s DURING %s@\n" Io_infer.Html.pp_hline () + (Exceptions.severity_string severity) + phase ; + ErrLogHash.iter (pp_err_log is_footprint severity) errlog + in + List.iter + Exceptions.[Advice; Error; Info; Like; Warning] + ~f:(fun severity -> pp severity true "FOOTPRINT" ; pp severity false "RE-EXECUTION") (** Add an error description to the error log unless there is