debug.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program 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 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_DEBUG_H_
#define _PURPLE_DEBUG_H_
#include <glib.h>
#include <stdarg.h>
typedef enum
{
PURPLE_DEBUG_ALL = 0,
PURPLE_DEBUG_MISC,
PURPLE_DEBUG_INFO,
PURPLE_DEBUG_WARNING,
PURPLE_DEBUG_ERROR,
PURPLE_DEBUG_FATAL
} PurpleDebugLevel;
typedef struct
{
void (*print)(PurpleDebugLevel level, const char *category,
const char *arg_s);
gboolean (*is_enabled)(PurpleDebugLevel level,
const char *category);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
} PurpleDebugUiOps;
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
/**************************************************************************/
void purple_debug(PurpleDebugLevel level, const char *category,
const char *format, ...) G_GNUC_PRINTF(3, 4);
void purple_debug_misc(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
void purple_debug_info(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
void purple_debug_warning(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
void purple_debug_error(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
void purple_debug_fatal(const char *category, const char *format, ...) G_GNUC_PRINTF(2, 3);
void purple_debug_set_enabled(gboolean enabled);
gboolean purple_debug_is_enabled(void);
void purple_debug_set_verbose(gboolean verbose);
gboolean purple_debug_is_verbose(void);
void purple_debug_set_unsafe(gboolean unsafe);
gboolean purple_debug_is_unsafe(void);
/**************************************************************************/
/**************************************************************************/
void purple_debug_set_ui_ops(PurpleDebugUiOps *ops);
PurpleDebugUiOps *purple_debug_get_ui_ops(void);
/**************************************************************************/
/**************************************************************************/
void purple_debug_init(void);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_DEBUG_H_ */
purple_debug_init
void purple_debug_init(void)
Initializes the debug subsystem.
PURPLE_DEBUG_ERROR
Errors.
Definition: debug.h:41
purple_debug_set_verbose
void purple_debug_set_verbose(gboolean verbose)
Enable or disable verbose debugging.
PURPLE_DEBUG_ALL
All debug levels.
Definition: debug.h:37
PURPLE_DEBUG_INFO
General operation Information.
Definition: debug.h:39
PURPLE_DEBUG_FATAL
Fatal errors.
Definition: debug.h:42
purple_debug_set_ui_ops
void purple_debug_set_ui_ops(PurpleDebugUiOps *ops)
Sets the UI operations structure to be used when outputting debug information.
purple_debug_is_unsafe
gboolean purple_debug_is_unsafe(void)
Check if unsafe debugging is enabled.
purple_debug
void purple_debug(PurpleDebugLevel level, const char *category, const char *format,...) G_GNUC_PRINTF(3
Outputs debug information.
purple_debug_is_verbose
gboolean purple_debug_is_verbose(void)
Check if verbose logging is enabled.
purple_debug_error
void void void void void purple_debug_error(const char *category, const char *format,...) G_GNUC_PRINTF(2
Outputs error level debug information.
purple_debug_get_ui_ops
PurpleDebugUiOps * purple_debug_get_ui_ops(void)
Returns the UI operations structure used when outputting debug information.
PurpleDebugLevel
PurpleDebugLevel
Debug levels.
Definition: debug.h:35
PurpleDebugUiOps
Debug UI operations.
Definition: debug.h:49
purple_debug_is_enabled
gboolean purple_debug_is_enabled(void)
Check if console debug output is enabled.
purple_debug_set_unsafe
void purple_debug_set_unsafe(gboolean unsafe)
Enable or disable unsafe debugging.
purple_debug_info
void void void purple_debug_info(const char *category, const char *format,...) G_GNUC_PRINTF(2
Outputs info level debug information.
purple_debug_misc
void void purple_debug_misc(const char *category, const char *format,...) G_GNUC_PRINTF(2
Outputs misc.
purple_debug_warning
void void void void purple_debug_warning(const char *category, const char *format,...) G_GNUC_PRINTF(2
Outputs warning level debug information.
purple_debug_set_enabled
void void void void void void void purple_debug_set_enabled(gboolean enabled)
Enable or disable printing debug output to the console.
purple_debug_fatal
void void void void void void purple_debug_fatal(const char *category, const char *format,...) G_GNUC_PRINTF(2
Outputs fatal error level debug information.
PURPLE_DEBUG_WARNING
Warnings.
Definition: debug.h:40
PURPLE_DEBUG_MISC
General chatter.
Definition: debug.h:38