1 /* 2 * debug.h 3 * 4 * 5 * Authors: 6 * Bernhard Schuster <bernhard@ahoi.io> 7 * 8 * Web page: https://ahoi.io/project/oregano 9 * 10 * Copyright (C) 2012-2013 Bernhard Schuster 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License as 14 * published by the Free Software Foundation; either version 2 of the 15 * License, or (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public 23 * License along with this program; if not, write to the 24 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 25 * Boston, MA 02110-1301, USA. 26 */ 27 28 #include <glib/gprintf.h> 29 30 #ifdef DEBUG_THIS 31 #undef DEBUG_THIS 32 #endif 33 #define DEBUG_THIS 0 34 35 #ifndef DEBUG_ALL 36 #define DEBUG_ALL 0 37 #endif 38 39 #define NG_DEBUG(msg, ...) \ 40 { \ 41 if (DEBUG_THIS || DEBUG_ALL) { \ 42 g_printf ("%s:%d @ %s +++ " msg "\n", __FILE__, __LINE__, __FUNCTION__, \ 43 ##__VA_ARGS__); \ 44 } \ 45 } 46