| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | type flag |
| 12 | |
| 13 | type t = (unit -> Pp.t) -> unit |
| 14 | |
| 15 | (** Creates a debug component, which may be used to print debug |
| 16 | messages. |
| 17 | |
| 18 | A debug component is named by the string [name]. It is either |
| 19 | active or inactive. |
| 20 | |
| 21 | The special component ["all"] may be used to control all components. |
| 22 | |
| 23 | There is also a special component ["backtrace"] to control |
| 24 | backtrace recording. |
| 25 | *) |
| 26 | val create : name:string -> unit -> t |
| 27 | |
| 28 | (** Useful when interacting with a component from code, typically when |
| 29 | doing something more complicated than printing. |
| 30 | |
| 31 | Note that the printer function prints some metadata compared to |
| 32 | [ fun pp -> if get_flag flag then Feedback.msg_debug (pp ()) ] |
| 33 | *) |
| 34 | val create_full : name:string -> unit -> flag * t |
| 35 | |
| 36 | val get_flag : flag -> bool |
| 37 | |
| 38 | val set_flag : flag -> bool -> unit |
| 39 | |
| 40 | (** [get_flags] and [set_flags] use the user syntax: a comma separated |
| 41 | list of activated "component" and "-component"s. [get_flags] starts |
| 42 | with "all" or "-all" and lists all components after it (even if redundant). *) |
| 43 | val get_flags : unit -> string |
| 44 | |
| 45 | (** Components not mentioned are not affected (use the "all" component |
| 46 | at the start if you want to reset everything). *) |
| 47 | val set_flags : string -> unit |
| 48 | |
| 49 | val set_debug_all : bool -> unit |
| 50 | |
| 51 | val misc : flag |
| 52 | val pp_misc : t |