Commit 6429b2e8 authored by François Bobot's avatar François Bobot

[Debug] enable the usual behavior of stderr: flush at every new line

parent 4b3bd156
......@@ -63,9 +63,22 @@ let timestamp = register_info_flag "timestamp"
let time_start = Unix.gettimeofday ()
let set_debug_formatter = (:=) formatter
let set_debug_formatter f =
(** enable the usual behavior of stderr: flush at every new line *)
let out,flush,newline,spaces =
Format.pp_get_all_formatter_output_functions f () in
Format.pp_set_all_formatter_output_functions
f
~out
~flush
~newline:(fun () -> newline (); flush ())
~spaces;
formatter := f
let get_debug_formatter () = !formatter
let () = set_debug_formatter Format.err_formatter
let dprintf flag s =
if !flag then
begin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment