nanohttp-logging.h

Go to the documentation of this file.
00001 /******************************************************************
00002  *  $Id: nanohttp-logging.h,v 1.5 2006/12/10 19:21:06 m0gg Exp $
00003  * 
00004  * CSOAP Project:  A http client/server library in C
00005  * Copyright (C) 2003-2006  Ferhat Ayaz
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the
00019  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA  02111-1307, USA.
00021  * 
00022  * Email: hero@persua.de
00023  ******************************************************************/
00024 #ifndef __nanohttp_logging_h
00025 #define __nanohttp_logging_h
00026 
00027 #define NHTTP_ARG_LOGFILE       "-NHTTPlog"
00028 #define NHTTP_ARG_LOGLEVEL      "-NHTTPloglevel"
00029 
00030 /* logging stuff */
00031 typedef enum log_level
00032 {
00033   HLOG_VERBOSE,
00034   HLOG_DEBUG,
00035   HLOG_INFO,
00036   HLOG_WARN,
00037   HLOG_ERROR,
00038   HLOG_FATAL,
00039   HLOG_OFF
00040 } log_level_t;
00041 
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00056 extern log_level_t hlog_set_level(log_level_t level);
00057 
00065 extern log_level_t hlog_get_level(void);
00066 
00074 extern void hlog_set_file(const char *filename);
00075 
00083 extern char *hlog_get_file(void);
00084 
00085 #ifdef WIN32
00086 #if defined(_MSC_VER) && _MSC_VER <= 1200
00087 char *VisualC_funcname(const char *file, int line);     /* not thread safe! */
00088 #define __FUNCTION__  VisualC_funcname(__FILE__, __LINE__)
00089 #endif
00090 #endif
00091 
00092 extern void hlog_verbose(const char *FUNC, const char *format, ...);
00093 extern void hlog_debug(const char *FUNC, const char *format, ...);
00094 extern void hlog_info(const char *FUNC, const char *format, ...);
00095 extern void hlog_warn(const char *FUNC, const char *format, ...);
00096 extern void hlog_error(const char *FUNC, const char *format, ...);
00097 
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101 
00110 #define log_verbose1(a1) hlog_verbose(__FUNCTION__, a1)
00111 #define log_verbose2(a1,a2) hlog_verbose(__FUNCTION__, a1,a2)
00112 #define log_verbose3(a1,a2,a3) hlog_verbose(__FUNCTION__, a1,a2,a3)
00113 #define log_verbose4(a1,a2,a3,a4) hlog_verbose(__FUNCTION__, a1,a2,a3,a4)
00114 #define log_verbose5(a1,a2,a3,a4,a5) hlog_verbose(__FUNCTION__, a1,a2,a3,a4,a5)
00115 
00116 #define log_debug1(a1) hlog_debug(__FUNCTION__, a1)
00117 #define log_debug2(a1,a2) hlog_debug(__FUNCTION__, a1,a2)
00118 #define log_debug3(a1,a2,a3) hlog_debug(__FUNCTION__, a1,a2,a3)
00119 #define log_debug4(a1,a2,a3,a4) hlog_debug(__FUNCTION__, a1,a2,a3,a4)
00120 #define log_debug5(a1,a2,a3,a4,a5) hlog_debug(__FUNCTION__, a1,a2,a3,a4,a5)
00121 
00122 #define log_info1(a1) hlog_info(__FUNCTION__, a1)
00123 #define log_info2(a1,a2) hlog_info(__FUNCTION__, a1,a2)
00124 #define log_info3(a1,a2,a3) hlog_info(__FUNCTION__, a1,a2,a3)
00125 #define log_info4(a1,a2,a3,a4) hlog_info(__FUNCTION__, a1,a2,a3,a4)
00126 #define log_info5(a1,a2,a3,a4,a5) hlog_info(__FUNCTION__, a1,a2,a3,a4,a5)
00127 
00128 #define log_warn1(a1) hlog_warn(__FUNCTION__, a1)
00129 #define log_warn2(a1,a2) hlog_warn(__FUNCTION__, a1,a2)
00130 #define log_warn3(a1,a2,a3) hlog_warn(__FUNCTION__, a1,a2,a3)
00131 #define log_warn4(a1,a2,a3,a4) hlog_warn(__FUNCTION__, a1,a2,a3,a4)
00132 #define log_warn5(a1,a2,a3,a4,a5) hlog_warn(__FUNCTION__, a1,a2,a3,a4,a5)
00133 
00134 #define log_error1(a1) hlog_error(__FUNCTION__, a1)
00135 #define log_error2(a1,a2) hlog_error(__FUNCTION__, a1,a2)
00136 #define log_error3(a1,a2,a3) hlog_error(__FUNCTION__, a1,a2,a3)
00137 #define log_error4(a1,a2,a3,a4) hlog_error(__FUNCTION__, a1,a2,a3,a4)
00138 #define log_error5(a1,a2,a3,a4,a5) hlog_error(__FUNCTION__, a1,a2,a3,a4,a5)
00139 
00140 #endif

Generated on Thu Jan 25 23:36:02 2007 for csoap by  doxygen 1.4.6