1 /*
2  *  Copyright (C) 2005 Marc Pavot <marc.pavot@gmail.com>
3  *
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, or (at your option)
7  *  any later version.
8  *
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.
13  *
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef __ARIO_DEBUG_H
21 #define __ARIO_DEBUG_H
22 
23 #include <config.h>
24 #include <stdio.h>
25 
26 /* Macro used to log an error */
27 #define ARIO_LOG_ERROR(x,args...) {printf("[ERROR](%s:%d) %s : " x "\n", __FILE__, __LINE__, __FUNCTION__, ##args);}
28 
29 /* Macro used to log an information */
30 #define ARIO_LOG_INFO(x,args...) {printf("[info]" x "\n", ##args);}
31 
32 #ifdef DEBUG
33 /* Macro used to log a debug information */
34 #define ARIO_LOG_DBG(x,args...) {printf("[debug](%s:%d) %s : " x "\n", __FILE__, __LINE__, __FUNCTION__, ##args);}
35 /* Macro used to log the start of a function */
36 #define ARIO_LOG_FUNCTION_START      ARIO_LOG_DBG("Function start")
37 #else
38 /* If DEBUG is not activated we don't log debug info */
39 #define ARIO_LOG_DBG(x,args...) {}
40 #define ARIO_LOG_FUNCTION_START
41 #endif
42 
43 #endif /* __ARIO_DEBUG_H */
44