mingw: tests compilation and run
[siplcs.git] / src / api / sipe-backend-debug.h
blobcdc3e26a485f36dcd67d6e5206b0c8d478c35cee
1 /**
2 * @file sipe-backend-debug.h
4 * pidgin-sipe
6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 typedef enum {
24 SIPE_DEBUG_LEVEL_INFO,
25 SIPE_DEBUG_LEVEL_WARNING,
26 SIPE_DEBUG_LEVEL_ERROR,
27 SIPE_DEBUG_LEVEL_FATAL,
28 } sipe_debug_level;
30 /**
31 * Output debug information
33 * Shouldn't be used directly. Instead use SIPE_DEBUG_xxx() macros
35 * @param level debug level
36 * @param format format string. "\n" will be automatically appended.
38 void sipe_backend_debug(sipe_debug_level level,
39 const gchar *format,
40 ...) G_GNUC_PRINTF(2, 3);
42 /* Convenience macros */
43 #define SIPE_DEBUG_INFO(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_INFO, fmt, __VA_ARGS__)
44 #define SIPE_DEBUG_INFO_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_INFO, msg)
45 #define SIPE_DEBUG_WARNING(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_WARNING, fmt, __VA_ARGS__)
46 #define SIPE_DEBUG_WARNING_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_WARNING, msg)
47 #define SIPE_DEBUG_ERROR(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_ERROR, fmt, __VA_ARGS__)
48 #define SIPE_DEBUG_ERROR_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_ERROR, msg)
49 #define SIPE_DEBUG_FATAL(fmt, ...) sipe_backend_debug(SIPE_DEBUG_LEVEL_FATAL, fmt, __VA_ARGS__)
50 #define SIPE_DEBUG_FATAL_NOFORMAT(msg) sipe_backend_debug(SIPE_DEBUG_LEVEL_FATAL, msg)