[logging] don't clobber progress bar with call graph schedule

Reviewed By: jvillard

Differential Revision: D15696411

fbshipit-source-id: 09fd2cdf3
master
Nikos Gorogiannis 6 years ago committed by Facebook Github Bot
parent 19b445e00c
commit 66c45a7f54

@ -32,7 +32,7 @@ let analyze_target : TaskScheduler.target Tasks.doer =
let analyze_proc_name exe_env proc_name = let analyze_proc_name exe_env proc_name =
decr procs_left ; decr procs_left ;
if Int.( <= ) !procs_left 0 then ( if Int.( <= ) !procs_left 0 then (
L.progress "Analysing block of %d procs, starting with %a@." L.log_task "Analysing block of %d procs, starting with %a@."
per_procedure_logging_granularity Typ.Procname.pp proc_name ; per_procedure_logging_granularity Typ.Procname.pp proc_name ;
procs_left := per_procedure_logging_granularity ) ; procs_left := per_procedure_logging_granularity ) ;
Callbacks.analyze_proc_name exe_env proc_name Callbacks.analyze_proc_name exe_env proc_name

@ -208,15 +208,15 @@ let phase fmt = log ~to_console:false phase_file_fmts fmt
let progress fmt = log ~to_console:(not Config.quiet) progress_file_fmts fmt let progress fmt = log ~to_console:(not Config.quiet) progress_file_fmts fmt
let task_progress ~f pp x = let log_task fmt =
let to_console = let to_console =
match Config.progress_bar with `Plain -> true | `Quiet | `MultiLine -> false match Config.progress_bar with `Plain -> true | `Quiet | `MultiLine -> false
in in
log ~to_console progress_file_fmts "%a starting@." pp x ; log ~to_console progress_file_fmts fmt
f () ;
log ~to_console progress_file_fmts "%a DONE@." pp x
let task_progress ~f pp x = log_task "%a starting@." pp x ; f () ; log_task "%a DONE@." pp x
let user_warning fmt = log ~to_console:(not Config.quiet) user_warning_file_fmts fmt let user_warning fmt = log ~to_console:(not Config.quiet) user_warning_file_fmts fmt
let user_error fmt = log ~to_console:true user_error_file_fmts fmt let user_error fmt = log ~to_console:true user_error_file_fmts fmt

@ -23,6 +23,9 @@ val environment_info : ('a, F.formatter, unit) format -> 'a
val progress : ('a, F.formatter, unit) format -> 'a val progress : ('a, F.formatter, unit) format -> 'a
(** print immediately to standard error unless --quiet is specified *) (** print immediately to standard error unless --quiet is specified *)
val log_task : ('a, F.formatter, unit) format -> 'a
(** log progress in the log file and on the console unless there is an active task bar *)
val task_progress : f:(unit -> unit) -> (F.formatter -> 'a -> unit) -> 'a -> unit val task_progress : f:(unit -> unit) -> (F.formatter -> 'a -> unit) -> 'a -> unit
(** [task_progress ~f pp x] executes [f] and log progress [pp x] in the log file and also on the (** [task_progress ~f pp x] executes [f] and log progress [pp x] in the log file and also on the
console unless there is an active task bar *) console unless there is an active task bar *)

Loading…
Cancel
Save