debug.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #ifndef __LIBNICE_DEBUG_H__
  37. #define __LIBNICE_DEBUG_H__
  38. /**
  39. * SECTION:debug
  40. * @short_description: Debug messages utility functions
  41. * @stability: Unstable
  42. *
  43. * <para>Libnice can output a lot of information when debug messages are enabled.
  44. * This can significantly help track down problems and/or understand what
  45. * it's doing.</para>
  46. *
  47. * <para>You can enable/disable the debug messages by calling nice_debug_enable()
  48. * or nice_debug_disable() and choosing whether you want only ICE debug messages
  49. * or also stun debug messages.</para>
  50. *
  51. * <para>By default, the debug messages are disabled, unless the environment
  52. * variable NICE_DEBUG is set, in which case, it must contain a comma separated
  53. * list of flags specifying which debug to enable.</para>
  54. * <para> The currently available flags are "nice", "stun", "pseudotcp",
  55. * "pseudotcp-verbose" or "all" to enable all debug messages.</para>
  56. * <para> If the 'pseudotcp' flag is enabled, then 'pseudotcp-verbose' gets
  57. * automatically disabled. This is to allow the use of the 'all' flag without
  58. * having verbose messages from pseudotcp. You can enable verbose debug messages
  59. * from the pseudotcp layer by specifying 'pseudotcp-verbose' without the
  60. * 'pseudotcp' flag.</para>
  61. *
  62. *
  63. * <para>This API is unstable and is subject to change at any time...
  64. * More flags are to come and a better API to enable/disable each flag
  65. * should be added.</para>
  66. */
  67. #include <glib.h>
  68. G_BEGIN_DECLS
  69. /**
  70. * nice_debug_enable:
  71. * @with_stun: Also enable STUN debugging messages
  72. *
  73. * Enables libnice debug output to the terminal. Note that the
  74. * `G_MESSAGES_DEBUG` and `NICE_DEBUG` environment variables must be set to the
  75. * set of logging domains to print, in order for any output to be printed. Set
  76. * them to `all` to print all debugging messages, or any of the following
  77. * domains:
  78. * - `libnice-stun`
  79. * - `libnice-tests`
  80. * - `libnice-socket`
  81. * - `libnice`
  82. * - `libnice-pseudotcp`
  83. * - `libnice-pseudotcp-verbose`
  84. */
  85. void nice_debug_enable (gboolean with_stun);
  86. /**
  87. * nice_debug_disable:
  88. * @with_stun: Also disable stun debugging messages
  89. *
  90. * Disables libnice debug output to the terminal
  91. */
  92. void nice_debug_disable (gboolean with_stun);
  93. G_END_DECLS
  94. #endif /* __LIBNICE_DEBUG_H__ */