log.h

Go to the documentation of this file.
00001 /*
00002  ** Copyright (C) 2006-2008 INL
00003  ** Written by Victor Stinner <haypo@inl.fr>
00004  ** INL http://www.inl.fr/
00005  **
00006  ** $Id: log.h 4323 2008-01-18 09:12:11Z pollux $
00007  **
00008  ** This program is free software; you can redistribute it and/or modify
00009  ** it under the terms of the GNU General Public License as published by
00010  ** the Free Software Foundation, version 3 of the License.
00011  **
00012  ** This program 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
00015  ** GNU General Public License for more details.
00016  **
00017  ** You should have received a copy of the GNU General Public License
00018  ** along with this program; if not, write to the Free Software
00019  ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020  */
00021 
00022 
00023 #ifndef NUBASE_LOG_HEADER
00024 #define NUBASE_LOG_HEADER
00025 
00026 #ifdef HAVE_CONFIG_H
00027 #  include "config.h"
00028 #endif
00029 #include <syslog.h>
00030 #include "debug.h"
00031 
00038 #define SYSLOG_OPTS \
00039         LOG_CONS||LOG_PID               
00040 #define LOG_TO_STD        1     
00041 #define LOG_TO_SYSLOG 2         
00049 extern int log_engine;
00050 
00051 extern int debug_level;         
00052 extern int debug_areas;         
00054 void init_log_engine(const char* log_id);
00055 void log_printf(debug_level_t priority, char *format, ...)
00056 #ifdef __GNUC__
00057         __attribute__((__format__(printf,2,3)))
00058 #endif
00059 ;
00060 
00061 void log_area_printf(debug_area_t area, debug_level_t priority, char *format, ...)
00062 #ifdef __GNUC__
00063         __attribute__((__format__(printf,3,4)))
00064 #endif
00065 ;
00066 
00070 #ifdef DEBUG_ENABLE
00071 #  define debug_log_printf(area, priority, format, args...) \
00072         log_area_printf(area, priority, format, ##args )
00073 #else
00074 #  define debug_log_printf(area, priority, format, ...)
00075 #endif
00076 
00077 #endif                          /* ifndef NUBASE_LOG_HEADER */

Generated on Sat Nov 22 04:00:37 2008 for NuFW by  doxygen 1.4.7