eurephia_log.h

Go to the documentation of this file.
00001 /* eurephia_log.h  --  eurephia logging module
00002  *
00003  *  GPLv2 only - Copyright (C) 2008 - 2010
00004  *               David Sommerseth <dazo@users.sourceforge.net>
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; version 2
00009  *  of the License.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  *
00020  */
00021 
00031 #ifndef         EUREPHIA_LOG_H_
00032 #define         EUREPHIA_LOG_H_
00033 
00034 #include <eurephia_log_struct.h>
00035 #include <eurephia_context.h>
00036 
00037 #ifdef ENABLE_DEBUG
00038 #warning ######   DEBUG LOGGING IS ENABLED - THIS COULD BE A SECURITY ISSUE   ######
00039 
00044 #define DEBUG(ctx, log_level, log_string...) _eurephia_log_func(ctx, LOG_DEBUG, log_level, __FILE__, __LINE__, ## log_string);
00045 #else
00046 #define DEBUG(ctx, lvl, rest...) {};
00047 #endif
00048 
00049 #ifdef SHOW_SECRETS
00050 #warning ##########################################################################################
00051 #warning ##                                                                                      ##
00052 #warning ##  DEBUG LOGGING WITH SHOW_SECRETS IS ENABLED - THIS WILL LOG PASSWORDS IN CLEAR TEXT  ##
00053 #warning ##                                                                                      ##
00054 #warning ##########################################################################################
00055 #endif
00056 
00057 int eurephia_log_init(eurephiaCTX *ctx, const char *ident, const char *dest, int loglvl);
00058 void eurephia_log_close(eurephiaCTX *ctx);
00059 
00069 #define eurephia_log(ctx, dst, lvl, log_string...) _eurephia_log_func(ctx, dst, lvl, __FILE__, __LINE__, ## log_string)
00070 void _eurephia_log_func(eurephiaCTX *ctx, int logdst, int loglvl, const char *file, int line,
00071                         const char *fmt, ... );
00072 #endif      /* !EUREPHIA_LOG_H_ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines