Skip to content
This repository
Newer
Older
100644 112 lines (97 sloc) 4.374 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (** a simple debug tracer for libqml & depends
19 @author Mathieu Barbin - samedi 18 avril 2009, 15:19:34 (UTC+0100) *)
20
21 (**
22 lundi 1 juin 2009, 23:10:42 (UTC+0100)
23 to be sure that it will not be any debug interface for release version, the DebugTracer is not available
24 if the mode mlstate_debug is not activated.
25 *)
26
27 val now : ?time:float -> unit -> string
28 val year : unit -> string
29 val htmlescaped : string -> string
30
31 #<< type data = string (** can be later Lazy, but YAGNI *) >>#;
32 #<< module Debug : (** interface type is common for every tracers *) >>#;
33 #<< sig >>#;
34 #<< type id >>#;
35 #<< type t = string * data list (** each module could say something about a topic-item *) >>#;
36 #<< type tree = (id * t list) list (** for each topic, has a list of t *) >>#;
37 #<< val create : string -> id >>#;
38 #<< val compare : id -> id -> int >>#;
39 #<< val to_string : id -> string >>#;
40 #<< val warning : id >>#;
41 #<< val error : id >>#;
42 #<< val info : id >>#;
43 #<< end >>#;
44 #<< >>#;
45
46 #<< (** Extending the available tracers *) >>#;
47 #<< >>#;
48 #<< (** a specialized module to produce a diagnostic file *) >>#;
49 #<< module type SPEDEBUGTRACER = >>#;
50 #<< sig >>#;
51 #<< val ext : string >>#;
52 #<< val generator : libname:string -> libversion:string -> Debug.tree -> string * string (** returns (extension, contents) *) >>#;
53 #<< end >>#;
54 #<< >>#;
55 #<< (** We do a Module.fold_left with all specialized tracer, to produce the final tracer *) >>#;
56 #<< module type DEBUGTRACER = >>#;
57 #<< sig >>#;
58 #<< val ext : string list (** accumulation of specialized extension *) >>#;
59 #<< val generate : libname:string -> libversion:string -> Debug.tree -> (string * string) list (** accumulation of specialized productions *) >>#;
60 #<< end >>#;
61 #<< >>#;
62 #<< (** Module.fold_left *) >>#;
63 #<< module EmptyTracer : DEBUGTRACER >>#;
64 #<< module AddTracer : functor (Tracer : DEBUGTRACER) -> functor (Spe : SPEDEBUGTRACER) -> DEBUGTRACER >>#;
65
66 #<< (** The current spe-tracer(s) & the tracer build by adding it to the empty tracer *) >>#;
67 #<< module HTMLTracer : SPEDEBUGTRACER >>#;
68 #<< module DebugTracer : DEBUGTRACER >>#;
69
70 (** The main module *)
71 module type DEBUGINTERFACE =
72 sig
73 (** In any case : Reduced interface is colored messages only *)
74 val error : ?ending:(string -> 'a) -> ?color:Ansi.color -> string -> string -> 'a
75 val warning : string -> ?color:Ansi.color -> string -> unit
76 val verbose : string -> ?color:Ansi.color -> string -> unit
77 val withcolor : bool -> unit (** default is Parameter.withcolor *)
78
79 (** whisper : print something to stdout only if quiet = true with no `plot` (= no extra transformation on the string) *)
80 val whisper : string -> unit
81 #<< val debug : string -> Debug.id -> string -> unit >>#;
82 #<< val set_trace_prefix : string -> unit >>#;
83 #<< val trace : ?verbose:bool -> unit -> unit (** default is verbose:true *) >>#;
84 #<< val suspend : unit -> unit >>#;
85 #<< val active : unit -> unit (** start is unactive *) >>#;
86 #<< val is_active : unit -> bool >>#;
87 end
88
89 module type INTERFACEPARAMETER =
90 sig
91 val libname : string
92 val version : string
93 val quiet : unit -> bool
94 module DefaultColor :
95 sig
96 val error : Ansi.color
97 val warning : Ansi.color
98 val verbose : Ansi.color
99 val withcolor : bool
100 end
101 end
102
103 module MakeDebugInterface :
104 functor (InterfaceParameter : INTERFACEPARAMETER) ->
105 #<< functor (DebugTracer : DEBUGTRACER) -> >>#;
106 DEBUGINTERFACE
107
108 (* (\** The instanciation of a such interface for the libqml -- with the html tracer only as DebugTracer *\) *)
109 (* module LibqmlDebugInterface : DEBUGINTERFACE *)
110
111 (* (\** Facilities for acces to the LibqmlDebugInterface *\) *)
112 (* include DEBUGINTERFACE *)
Something went wrong with that request. Please try again.