1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * Copyright (C) 2006,2007,2008,2009 Nedko Arnaudov <nedko@arnaudov.name>
6 * This program 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; version 2 of the License
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *****************************************************************************/
21 #ifndef LOG_H__7097F6FE_4FEE_4962_9542_60375961F567__INCLUDED
22 #define LOG_H__7097F6FE_4FEE_4962_9542_60375961F567__INCLUDED
28 } /* Adjust editor indent */
31 void zyn_log(int level
, const char * format
, ...);
34 { /* Adjust editor indent */
40 #define LOG_LEVEL_DEBUG 0
41 #define LOG_LEVEL_INFO 1
42 #define LOG_LEVEL_WARNING 2
43 #define LOG_LEVEL_NOTICE 3
44 #define LOG_LEVEL_ERROR 4
45 #define LOG_LEVEL_FATAL 5
46 #define LOG_LEVEL_BLACK_HOLE 6
48 #if !defined(LOG_LEVEL)
49 #define LOG_LEVEL LOG_LEVEL_WARNING
52 #if LOG_LEVEL <= LOG_LEVEL_DEBUG
53 # define LOG_DEBUG(format, arg...) \
54 zyn_log(LOG_LEVEL_DEBUG, \
57 # define LOG_DEBUG(format, arg...)
60 #if LOG_LEVEL <= LOG_LEVEL_INFO
61 # define LOG_INFO(format, arg...) \
62 zyn_log(LOG_LEVEL_INFO, \
65 # define LOG_INFO(format, arg...)
68 #if LOG_LEVEL <= LOG_LEVEL_WARNING
69 # define LOG_WARNING(format, arg...) \
70 zyn_log(LOG_LEVEL_WARNING, \
73 # define LOG_WARNING(format, arg...)
76 #if LOG_LEVEL <= LOG_LEVEL_NOTICE
77 # define LOG_NOTICE(format, arg...) \
78 zyn_log(LOG_LEVEL_NOTICE, \
81 # define LOG_NOTICE(format, arg...)
84 #if LOG_LEVEL <= LOG_LEVEL_ERROR
85 # define LOG_ERROR(format, arg...) \
86 zyn_log(LOG_LEVEL_ERROR, \
89 # define LOG_ERROR(format, arg...)
92 #if LOG_LEVEL <= LOG_LEVEL_FATAL
93 # define LOG_FATAL(format, arg...) \
94 zyn_log(LOG_LEVEL_FATAL, \
97 # define LOG_FATAL(format, arg...)
100 #endif /* #ifndef LOG_H__7097F6FE_4FEE_4962_9542_60375961F567__INCLUDED */