forked from paparazzi/pprzlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugPL.mli
50 lines (44 loc) · 1.91 KB
/
debugPL.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(*
* Debugging facilities
*
* Copyright (C) 2004 CENA/ENAC, Pascal Brisset, Antoine Drouin
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*)
(** Module for outputting debug information *)
val log : out_channel ref
(** The log file. Default value is "debug_log". The debug output channel can
be changed by [DebugPL.log := out_channel].
The output channel gets back to its default value after each call to
[DebugPL.call] *)
val call : char -> (out_channel -> unit) -> unit
(** [call debug_level output_function] outputs a message to the current
channel [!DebugPL.log]
[debug_level] is a flag to categorize the debug message.
The environment variable PPRZ_DEBUG contains the active debug levels.
[call debug_level output_function] outputs its message iff PPRZ_DEBUG
contains the character [debug_level] or [*]
[output_function]
[DebugPL.call 'x' (fun c -> Printf.fprintf c "message")] outputs ["message"]
iff the flag 'x' is active (ie PPRZ_DEBUG contains the character ['x']) *)
(** No debug information is output if the program was compiled with the
-noassert flag *)
val trace : char -> string -> unit
val xprint : string -> string
(** Returns the hexadecimal representation of a string *)