2 * Copyright (C) 2007-2008 Felipe Contreras
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
27 #if defined(PECAN_DEBUG)
29 /* #define PECAN_DEBUG_MSG */
30 /* #define PECAN_DEBUG_SLPMSG */
31 /* #define PECAN_DEBUG_HTTP */
33 /* #define PECAN_DEBUG_SLP_VERBOSE */
34 /* #define PECAN_DEBUG_SLP_FILES */
36 /* #define PECAN_DEBUG_NS */
37 /* #define PECAN_DEBUG_SB */
38 /* #define PECAN_DEBUG_DC */
40 /* #define PECAN_DEBUG_DC_FILES */
45 PECAN_LOG_LEVEL_ERROR,
46 PECAN_LOG_LEVEL_WARNING,
48 PECAN_LOG_LEVEL_DEBUG,
52 typedef enum PecanLogLevel PecanLogLevel;
54 void msn_base_log_helper (PecanLogLevel level, const gchar *file, const gchar *function, gint line, const gchar *fmt, ...);
55 void msn_dump_file (const gchar *buffer, gsize len);
57 #define pecan_print(...) g_print (__VA_ARGS__);
59 #define msn_base_log(level, ...) msn_base_log_helper (level, __FILE__, __func__, __LINE__, __VA_ARGS__);
61 #define pecan_error(...) msn_base_log (PECAN_LOG_LEVEL_ERROR, __VA_ARGS__);
62 #define pecan_warning(...) msn_base_log (PECAN_LOG_LEVEL_WARNING, __VA_ARGS__);
63 #define pecan_info(...) msn_base_log (PECAN_LOG_LEVEL_INFO, __VA_ARGS__);
64 #define pecan_debug(...) msn_base_log (PECAN_LOG_LEVEL_DEBUG, __VA_ARGS__);
65 #define pecan_log(...) msn_base_log (PECAN_LOG_LEVEL_LOG, __VA_ARGS__);
67 #elif !defined(PECAN_DEBUG)
69 #define pecan_print(...) {}
70 #define pecan_error(...) {}
71 #define pecan_warning(...) {}
72 #define pecan_info(...) {}
73 #define pecan_debug(...) {}
74 #define pecan_log(...) {}
75 #define msn_dump_file(...) {}
77 #endif /* !defined(PECAN_DEBUG) */
79 #endif /* PECAN_LOG_H */