[debug] add `Logging.debug_dev` for temporary debugging

Summary:
Utility function that's basically `Logging.progress` but with a more obvious
name for debugging.

The `[@deprecated ...]` ensures no uses gets landed, and the `[@warning "-32"]` ensures that it's not a compile error that there are no uses of this function.

Inspired by #716.

Reviewed By: mbouaziz

Differential Revision: D7443224

fbshipit-source-id: e94798f
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent dad8b73f48
commit 5155417800

@ -163,6 +163,8 @@ let log ~to_console ?(to_file= true) (lazy formatters) =
let debug_file_fmts = register_formatter "debug"
let debug_dev_file_fmts = register_formatter "local debug"
let environment_info_file_fmts = register_formatter "environment"
let external_warning_file_fmts = register_formatter "extern warn"
@ -218,6 +220,8 @@ let debug_level_of_int n =
if n <= 0 then Quiet else if Int.equal n 1 then Medium else (* >= 2 *) Verbose
let debug_dev fmt = log ~to_console:true debug_dev_file_fmts fmt
let analysis_debug_level = debug_level_of_int Config.debug_level_analysis
let bufferoverrun_debug_level = debug_level_of_int Config.bo_debug

@ -63,6 +63,13 @@ type debug_level =
val debug : debug_kind -> debug_level -> ('a, F.formatter, unit) format -> 'a
(** log debug info *)
val debug_dev : ('a, Format.formatter, unit) format -> 'a
[@@deprecated
"Only use to debug during development. If you want more permanent logging, use \
[Logging.debug] instead."]
[@@warning "-32"]
(** For debugging during development. *)
(** Type of location in ml source: __POS__ *)
type ocaml_pos = string * int * int * int

Loading…
Cancel
Save