more logging cleanup: only print Errdesc.warning_err in developer mode

Reviewed By: jeremydubreil

Differential Revision: D2762994

fb-gh-sync-id: 780e7eb
master
Sam Blackshear 9 years ago committed by facebook-github-bot-7
parent 98557bb1fd
commit 812ac265a8

@ -1027,13 +1027,15 @@ let explain_null_test_after_dereference exp node line loc =
| None -> Localise.no_desc
let _warning loc fmt fmt_string =
F.fprintf fmt "%s:%d: Warning: " (DB.source_file_to_string !DB.current_source) loc.Location.line;
F.fprintf fmt fmt_string
(** Print a warning to the out stream, at the given location *)
let warning_out loc fmt_string =
_warning loc (Logging.get_out_formatter ()) fmt_string
if !Config.developer_mode then
begin
F.fprintf
fmt "%s:%d: Warning: " (DB.source_file_to_string !DB.current_source) loc.Location.line;
F.fprintf fmt fmt_string
end
else
F.ifprintf fmt fmt_string
(** Print a warning to the err stream, at the given location *)
(** Print a warning to the err stream at the given location (note: only prints in developer mode) *)
let warning_err loc fmt_string =
_warning loc (Logging.get_err_formatter ()) fmt_string

@ -140,10 +140,7 @@ val pvar_is_edg_tmp : Sil.pvar -> bool
(** Check whether the program variable is a temporary generated by the front-end *)
val pvar_is_frontend_tmp : Sil.pvar -> bool
(** Print a warning to the out stream, at the given location *)
val warning_out : Location.t -> ('a, Format.formatter, unit) format -> 'a
(** Print a warning to the err stream, at the given location *)
(** Print a warning to the err stream at the given location (note: only prints in developer mode) *)
val warning_err : Location.t -> ('a, Format.formatter, unit) format -> 'a
(* offset of an expression found following a program variable *)

@ -279,7 +279,7 @@ let propagate_nodes_divergence
| None -> _succ_nodes in
if !Config.footprint && not (Paths.PathSet.is_empty (State.get_diverging_states_node ())) then
begin
if !Config.developer_mode then Errdesc.warning_err (State.get_loc ()) "Propagating Divergence@.";
Errdesc.warning_err (State.get_loc ()) "Propagating Divergence@.";
let exit_node = Cfg.Procdesc.get_exit_node pdesc in
let diverging_states = State.get_diverging_states_node () in
let prop_incons =

@ -70,9 +70,6 @@ let current_out_formatter = ref F.std_formatter
(** Current formatter for the err stream *)
let current_err_formatter = ref F.err_formatter
(** Get the current out formatter *)
let get_out_formatter () = !current_out_formatter
(** Get the current err formatter *)
let get_err_formatter fmt = !current_err_formatter

@ -80,9 +80,6 @@ val stderr : ('a, Format.formatter, unit) format -> 'a
(** print immediately to standard output *)
val stdout : ('a, Format.formatter, unit) format -> 'a
(** Get the current out formatter *)
val get_out_formatter : unit -> Format.formatter
(** Get the current err formatter *)
val get_err_formatter : unit -> Format.formatter

@ -1429,7 +1429,9 @@ and sym_exec_call cfg pdesc tenv pre path ret_ids actual_pars summary loc =
!Config.curr_language = Config.Java)
then t_e else t) :: comb etl' tl'
| _,[] ->
if !Config.developer_mode then Errdesc.warning_err (State.get_loc ()) "likely use of variable-arguments function, or function prototype missing@.";
Errdesc.warning_err
(State.get_loc ())
"likely use of variable-arguments function, or function prototype missing@.";
L.d_warning "likely use of variable-arguments function, or function prototype missing"; L.d_ln();
L.d_str "actual parameters: "; Sil.d_exp_list (IList.map fst actual_pars); L.d_ln ();
L.d_str "formal parameters: "; Sil.d_typ_list formal_types; L.d_ln ();

Loading…
Cancel
Save