From 44de91f84b751a616c178839728fdf4a8360e557 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Tue, 15 Dec 2015 11:02:51 -0800 Subject: [PATCH] logging to stderr/stdout all the time Reviewed By: jvillard Differential Revision: D2760069 fb-gh-sync-id: f0f0f8c --- infer/src/backend/inferanalyze.ml | 2 +- infer/src/backend/logging.ml | 11 +++++++---- infer/src/backend/logging.mli | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/infer/src/backend/inferanalyze.ml b/infer/src/backend/inferanalyze.ml index 9f5c52053..feac1f87c 100644 --- a/infer/src/backend/inferanalyze.ml +++ b/infer/src/backend/inferanalyze.ml @@ -676,7 +676,7 @@ let setup_logging () = DB.create_dir log_dir; let analyzer_out_file = if !out_file_cmdline = "" then Filename.concat log_dir analyzer_out_name - else !out_file_cmdline in + else !out_file_cmdline in let analyzer_err_file = if !err_file_cmdline = "" then Filename.concat log_dir analyzer_err_name else !err_file_cmdline in diff --git a/infer/src/backend/logging.ml b/infer/src/backend/logging.ml index aff0c538d..0c7adbd0b 100644 --- a/infer/src/backend/logging.ml +++ b/infer/src/backend/logging.ml @@ -106,6 +106,9 @@ let get_delayed_prints () = !delayed_actions let do_print fmt fmt_string = + F.fprintf fmt fmt_string + +let do_print_in_developer_mode fmt fmt_string = if !Config.developer_mode then F.fprintf fmt fmt_string else @@ -113,17 +116,17 @@ let do_print fmt fmt_string = (** print to the current out stream (note: only prints in developer mode) *) let out fmt_string = - do_print !current_out_formatter fmt_string + do_print_in_developer_mode !current_out_formatter fmt_string (** print to the current err stream (note: only prints in developer mode) *) let err fmt_string = - do_print !current_err_formatter fmt_string + do_print_in_developer_mode !current_err_formatter fmt_string -(** print immediately to standard error (note: only prints in developer mode) *) +(** print immediately to standard error *) let stderr fmt_string = do_print F.err_formatter fmt_string -(** print immediately to standard output (note: only prints in developer mode) *) +(** print immediately to standard output *) let stdout fmt_string = do_print F.std_formatter fmt_string diff --git a/infer/src/backend/logging.mli b/infer/src/backend/logging.mli index c80285f51..90872b251 100644 --- a/infer/src/backend/logging.mli +++ b/infer/src/backend/logging.mli @@ -74,10 +74,10 @@ val out : ('a, Format.formatter, unit) format -> 'a (** print to the current err stream (note: only prints in developer mode) *) val err : ('a, Format.formatter, unit) format -> 'a -(** print immediately to standard error (note: only prints in developer mode) *) +(** print immediately to standard error *) val stderr : ('a, Format.formatter, unit) format -> 'a -(** print immediately to standard output (note: only prints in developer mode) *) +(** print immediately to standard output *) val stdout : ('a, Format.formatter, unit) format -> 'a (** Get the current out formatter *)