123456789101112131415161718192021222324252627282930313233(*
MSAT is free software, using the Apache license, see file LICENSE
Copyright 2014 Guillaume Bury
Copyright 2014 Simon Cruanes
*)(** {1 Logging functions, real version} *)letenabled=true(* NOTE: change here for 0-overhead *)letdebug_level_=ref0letset_debugl=debug_level_:=lletget_debug()=!debug_level_letdebug_fmt_=refFormat.std_formatterletset_debug_outf=debug_fmt_:=f(* does the printing, inconditionally *)letdebug_real_lk=k(funfmt->CCFormat.fprintf!debug_fmt_"@[<2>@{<Blue>[%d|%.3f]@}@ "l(Sys.time());Format.kfprintf(funfmt->Format.fprintffmt"@]@.")!debug_fmt_fmt)let[@inline]debugflk=ifenabled&&l<=!debug_level_then(debug_real_lk;)let[@inline]debuglmsg=debugfl(funk->k"%s"msg)