OSDN Git Service

* updated for freebsd
[modchxj/mod_chxj.git] / include / qs_log.h
1 /*
2  * Copyright (C) 2005-2011 Atsushi Konno All rights reserved.
3  * Copyright (C) 2005 QSDN,Inc. All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef __QS_LOG_H__
18 #define __QS_LOG_H__
19
20 #include "qs_parse_string.h"
21
22 #define QX_LOGMARK   __FILE__,__LINE__
23 #define QX_LOG_DEBUG (0)
24 #define QX_LOG_INFO  (1)
25 #define QX_LOG_WARN  (2)
26 #define QX_LOG_ERROR (3)
27 #define QX_LOG_FATAL (4)
28
29
30 #define QX_LOGGER_DEBUG(c)  qs_log(doc,QX_LOG_DEBUG,QX_LOGMARK,(c))
31 #define QX_LOGGER_INFO(c)   qs_log(doc,QX_LOG_INFO,QX_LOGMARK, (c))
32 #define QX_LOGGER_WARN(c)   qs_log(doc,QX_LOG_WARN,QX_LOGMARK, (c))
33 #define QX_LOGGER_ERROR(c)  qs_log(doc,QX_LOG_ERROR,QX_LOGMARK, (c))
34 #define QX_LOGGER_FATAL(c)  qs_log(doc,QX_LOG_FATAL,QX_LOGMARK,(c))
35 #define QX_LOGGER_DEBUG_INT(x,y)  qs_log_int(doc,QX_LOG_DEBUG,QX_LOGMARK,(x),(y))
36
37 extern void qs_log(
38   Doc           *doc,
39   int           log_level,
40   const char    *f, 
41   int           l,
42   char          *msg);
43
44 extern void qs_log_int(
45   Doc           *doc,
46   int           log_level,
47   const char    *f, 
48   int           l, 
49   char          *msg,
50   int           val);
51
52 #ifdef UNUSED
53 #elif defined(__GNUC__)
54 # define UNUSED(x) UNUSED_ ## x __attribute__((unused))
55 #elif defined(__LCLINT__)
56 # define UNUSED(x) /*@unused@*/ x
57 #else
58 # define UNUSED(x) x
59 #endif
60
61 #endif