c1a6473cd6f62e5466edc2b90f497b57cc562fc7
[platform/upstream/libnice.git] / agent / debug.h
1 /*
2  * This file is part of the Nice GLib ICE library.
3  *
4  * (C) 2008 Collabora Ltd.
5  *  Contact: Youness Alaoui
6  * (C) 2008 Nokia Corporation. All rights reserved.
7  *
8  * The contents of this file are subject to the Mozilla Public License Version
9  * 1.1 (the "License"); you may not use this file except in compliance with
10  * the License. You may obtain a copy of the License at
11  * http://www.mozilla.org/MPL/
12  *
13  * Software distributed under the License is distributed on an "AS IS" basis,
14  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
15  * for the specific language governing rights and limitations under the
16  * License.
17  *
18  * The Original Code is the Nice GLib ICE library.
19  *
20  * The Initial Developers of the Original Code are Collabora Ltd and Nokia
21  * Corporation. All Rights Reserved.
22  *
23  * Contributors:
24  *   Youness Alaoui, Collabora Ltd.
25  *
26  * Alternatively, the contents of this file may be used under the terms of the
27  * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
28  * case the provisions of LGPL are applicable instead of those above. If you
29  * wish to allow use of your version of this file only under the terms of the
30  * LGPL and not to allow others to use your version of this file under the
31  * MPL, indicate your decision by deleting the provisions above and replace
32  * them with the notice and other provisions required by the LGPL. If you do
33  * not delete the provisions above, a recipient may use your version of this
34  * file under either the MPL or the LGPL.
35  */
36
37 #ifndef __LIBNICE_DEBUG_H__
38 #define __LIBNICE_DEBUG_H__
39
40
41 /**
42  * SECTION:debug
43  * @short_description: Debug messages utility functions
44  * @stability: Unstable
45  *
46  * <para>Libnice can output a lot of information when debug messages are enabled.
47  * This can significantly help track down problems and/or understand what
48  * it's doing.</para>
49  *
50  * <para>You can enable/disable the debug messages by calling nice_debug_enable()
51  * or nice_debug_disable() and choosing whether you want only ICE debug messages
52  * or also stun debug messages.</para>
53  *
54  * <para>By default, the debug messages are disabled, unless the environment
55  * variable NICE_DEBUG is set, in which case, it must contain a comma separated
56  * list of flags specifying which debug to enable.</para>
57  * <para> The currently available flags are "nice", "stun", "pseudotcp",
58  * "pseudotcp-verbose" or "all" to enable all debug messages.</para>
59  * <para> If the 'pseudotcp' flag is enabled, then 'pseudotcp-verbose' gets
60  * automatically disabled. This is to allow the use of the 'all' flag without
61  * having verbose messages from pseudotcp. You can enable verbose debug messages
62  * from the pseudotcp layer by specifying 'pseudotcp-verbose' without the
63  * 'pseudotcp' flag.</para>
64  *
65  *
66  * <para>This API is unstable and is subject to change at any time...
67  * More flags are to come and a better API to enable/disable each flag
68  * should be added.</para>
69  */
70
71
72 #include <glib.h>
73
74 G_BEGIN_DECLS
75
76 /**
77  * nice_debug_enable:
78  * @with_stun: Also enable STUN debugging messages
79  *
80  * Enables libnice debug output to the terminal. Note that the
81  * `G_MESSAGES_DEBUG` and `NICE_DEBUG` environment variables must be set to the
82  * set of logging domains to print, in order for any output to be printed. Set
83  * them to `all` to print all debugging messages, or any of the following
84  * domains:
85  * - `libnice-stun`
86  * - `libnice-tests`
87  * - `libnice-socket`
88  * - `libnice`
89  * - `libnice-pseudotcp`
90  * - `libnice-pseudotcp-verbose`
91  */
92 void nice_debug_enable (gboolean with_stun);
93
94 /**
95  * nice_debug_disable:
96  * @with_stun: Also disable stun debugging messages
97  *
98  * Disables libnice debug output to the terminal
99  */
100 void nice_debug_disable (gboolean with_stun);
101
102 G_END_DECLS
103
104 #endif /* __LIBNICE_DEBUG_H__ */
105