Skip to content
Snippets Groups Projects
lv6Verbose.mli 1.33 KiB
Newer Older
Erwan Jahier's avatar
Erwan Jahier committed
(*----------------------------------------------------------------------
Erwan Jahier's avatar
Erwan Jahier committed
	date :
------------------------------------------------------------------------
	description :

	Affichage verbeux avec appel "printf-like" :

Erwan Jahier's avatar
Erwan Jahier committed
----------------------------------------------------------------------*)

val on : unit -> unit
val off : unit -> unit
val set : int -> unit

[@@ocaml.warning "+32"]
Pascal Raymond's avatar
Pascal Raymond committed

[@@ocaml.warning "-32"]

(* GESTION DES FLAGS DE VERBOSE POUR LE DEBUG "FIN" 
Pascal Raymond's avatar
Pascal Raymond committed
Usage typique :

- dans un module Toto, faire au début :

let dbgflag = Global.get_dbg_flag "Toto"

- puis utiliser dans le code :

Lv6Verbose.printf ~flag:dbg ...
Lv6Verbose.exe ~flag:dbg ...
Pascal Raymond's avatar
Pascal Raymond committed
 
- si "-dbg Toto" est passé en arguments
  tout les Lv6Verbose seront pris en compte
Pascal Raymond's avatar
Pascal Raymond committed
*)
type flag
val get_flag : string -> flag
val set_flag : flag -> unit
val flag_list : unit -> string list

val level : unit -> int
(* print/execute if EITHER:
   - level (dflt=1) is >= than the set level
   - flag is set
*)
Erwan Jahier's avatar
Erwan Jahier committed

val printf : ?level:int -> ?flag:flag -> ('a, unit, string, unit) format4 -> 'a
val put    : ?level:int -> ?flag:flag -> ('a, unit, string, unit) format4 -> 'a
val print_string : ?level:int -> ?flag:flag -> string -> unit 
val exe : ?level:int -> ?flag:flag -> (unit -> unit) -> unit

val profile_info : string -> unit