diff --git a/infer/src/backend/errlog.ml b/infer/src/backend/errlog.ml index 7c5dd21e9..2cf9104de 100644 --- a/infer/src/backend/errlog.ml +++ b/infer/src/backend/errlog.ml @@ -85,10 +85,18 @@ let size filter (err_log: t) = if filter ekind in_footprint then count := !count + (ErrDataSet.cardinal eds)) err_log; !count -(** Print an error log *) -let pp fmt (errlog : t) = - let f (ekind, infp, ename, desc, severity) locs = - if ekind == Exceptions.Kerror then F.fprintf fmt "%a@ " Localise.pp ename in +(** Print errors from error log *) +let pp_errors fmt (errlog : t) = + let f (ekind, _, ename, _, _) locs = + if ekind == Exceptions.Kerror then + F.fprintf fmt "%a@ " Localise.pp ename in + ErrLogHash.iter f errlog + +(** Print warnings from error log *) +let pp_warnings fmt (errlog : t) = + let f (ekind, _, ename, desc, _) locs = + if ekind == Exceptions.Kwarning then + F.fprintf fmt "%a %a@ " Localise.pp ename Localise.pp_error_desc desc in ErrLogHash.iter f errlog (** Print an error log in html format *) diff --git a/infer/src/backend/errlog.mli b/infer/src/backend/errlog.mli index ba9a3ae11..27b21637c 100644 --- a/infer/src/backend/errlog.mli +++ b/infer/src/backend/errlog.mli @@ -34,8 +34,11 @@ type iter_fun = (** Apply f to nodes and error names *) val iter : iter_fun -> t -> unit -(** Print an error log *) -val pp : Format.formatter -> t -> unit +(** Print errors from error log *) +val pp_errors : Format.formatter -> t -> unit + +(** Print warnings from error log *) +val pp_warnings : Format.formatter -> t -> unit (** Print an error log in html format *) val pp_html : DB.Results_dir.path -> Format.formatter -> t -> unit diff --git a/infer/src/backend/specs.ml b/infer/src/backend/specs.ml index e7b779000..b360179e5 100644 --- a/infer/src/backend/specs.ml +++ b/infer/src/backend/specs.ml @@ -345,7 +345,8 @@ let pp_timeout fmt = function let pp_stats err_log whole_seconds fmt stats = F.fprintf fmt "TIME:%a TIMEOUT:%a SYMOPS:%d CALLS:%d,%d@\n" (pp_time whole_seconds) stats.stats_time pp_timeout stats.stats_timeout stats.symops stats.stats_calls.Cg.in_calls stats.stats_calls.Cg.out_calls; - F.fprintf fmt "ERRORS: @[%a@]" Errlog.pp err_log + F.fprintf fmt "ERRORS: @[%a@]@." Errlog.pp_errors err_log; + F.fprintf fmt "WARNINGS: @[%a@]" Errlog.pp_warnings err_log (** Print the spec *) let pp_spec pe num_opt fmt spec =