1 /*
2  * Copyright (C) 2005 iptelorg GmbH
3  *
4  * This file is part of ser, a free SIP server.
5  *
6  * ser is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version
10  *
11  * For a license to use the ser software under conditions
12  * other than those described here, or to purchase support for this
13  * software, please contact iptel.org by e-mail at the following addresses:
14  *    info@iptel.org
15  *
16  * ser is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24  */
25 
26 #ifndef __LOGGER_H
27 #define __LOGGER_H
28 
29 #ifndef SER
30 
31 #include <stdio.h>
32 
33 #define ERROR_LOG(a,args...)		do{printf(a,##args);}while(0)
34 #define DEBUG_LOG(a,args...)		do{printf(a,##args);}while(0)
35 #define TRACE_LOG(a,args...)		do{printf(a,##args);}while(0)
36 #define WARN_LOG(a,args...)			do{printf(a,##args);}while(0)
37 #define FLUSH_LOG()					do{fflush(stdout);}while(0)
38 
39 #else
40 /* TODO: logging for SER */
41 
42 #include "dprint.h"
43 
44 #define ERROR_LOG(a,args...)		ERR(a,##args)
45 #define DEBUG_LOG(a,args...)		DBG(a,##args)
46 /* #define TRACE_LOG(a,args...)		ERR(a,##args) */
47 #define TRACE_LOG(fmt, args...)     LOG(L_ERR, "TRACE: "  LOC_INFO fmt, ##args)
48 #define WARN_LOG(a,args...)			WARN(a,##args)
49 #define FLUSH_LOG()					do{}while(0)
50 
51 #endif
52 
53 #endif
54