eurephia_log_struct.h

Go to the documentation of this file.
00001 /* eurephia_log.h  --  eurephia log struct definition
00002  *
00003  *  GPLv2 only - Copyright (C) 2009 - 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_STRUCT_H
00032 #define EUREPHIA_LOG_STRUCT_H
00033 
00034 #include <syslog.h>
00035 
00036 /*
00037  * A lot of these definitions are here to make sure LOG_* definitions will not
00038  * collide with syslog definitions.
00039  *
00040  */
00041 
00042 #ifndef LOG_INFO
00043 #define LOG_INFO  101           
00044 #endif
00045 
00046 #ifndef LOG_DEBUG
00047 #define LOG_DEBUG 102           
00048 #endif
00049 
00050 #ifndef LOG_WARNING
00051 #define LOG_WARNING 103         
00052 #endif
00053 
00054 #ifndef LOG_ERR
00055 #define LOG_ERR 104             
00056 #endif
00057 #define LOG_ERROR LOG_ERR       
00059 #ifndef LOG_CRIT
00060 #define LOG_CRIT 105            
00061 #endif
00062 #define LOG_CRITICAL LOG_CRIT   
00064 #ifndef LOG_ALERT
00065 #define LOG_ALERT 106           
00066 #endif
00067 #define LOG_FATAL LOG_ALERT     
00069 #ifndef LOG_EMERG
00070 #define LOG_EMERG 107           
00071 #endif
00072 #define LOG_PANIC LOG_EMERG     
00078 typedef enum { logFILE,         
00079                logSYSLOG        
00080 } eurephiaLOGTYPE;
00081 
00085 typedef struct {
00086         eurephiaLOGTYPE logtype; 
00087         unsigned int opened;     
00088         char *destination;       
00089         FILE *logfile;           
00090         int loglevel;            
00091 } eurephiaLOG;
00092 
00093 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines