Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

logger.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: logger.h,v $
00003                              -------------------
00004     cvs         : $Id: logger.h,v 1.7 2003/05/08 16:38:20 aquamaniac Exp $
00005     begin       : Sun Dec 05 2003
00006     copyright   : (C) 2003 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 #ifndef CH_LOGGER_H
00029 #define CH_LOGGER_H
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 typedef void (*LOGGERFUNCTIONLOG)(const char *s);
00036 
00037 
00038 CHIPCARD_API typedef enum {
00039   LoggerTypeConsole,
00040   LoggerTypeFile,
00041   LoggerTypeSyslog,
00042   LoggerTypeFunction
00043 } LOGGER_LOGTYPE;
00044 
00045 
00046 CHIPCARD_API typedef enum {
00047   LoggerFacilityAuth=0,
00048   LoggerFacilityDaemon,
00049   LoggerFacilityMail,
00050   LoggerFacilityNews,
00051   LoggerFacilityUser
00052 } LOGGER_FACILITY;
00053 
00054 
00055 CHIPCARD_API typedef enum {
00056   LoggerLevelEmergency=0,
00057   LoggerLevelAlert,
00058   LoggerLevelCritical,
00059   LoggerLevelError,
00060   LoggerLevelWarning,
00061   LoggerLevelNotice,
00062   LoggerLevelInfo,
00063   LoggerLevelDebug
00064 } LOGGER_LEVEL;
00065 
00066 
00067 
00079 CHIPCARD_API int Logger_Open(const char *ident,
00080                              const char *file,
00081                              LOGGER_LOGTYPE logtype,
00082                              LOGGER_FACILITY facility);
00083 
00088 CHIPCARD_API void Logger_Close();
00089 
00097 CHIPCARD_API int Logger_Log(LOGGER_LEVEL priority, const char *s);
00098 
00104 CHIPCARD_API void Logger_Enable(int f);
00105 
00111 CHIPCARD_API int Logger_IsEnabled();
00112 
00119 CHIPCARD_API void Logger_SetLevel(LOGGER_LEVEL l);
00120 
00125 CHIPCARD_API int Logger_GetLevel();
00126 
00127 
00133 CHIPCARD_API void Logger_SetIdent(const char *id);
00134 
00135 
00141 CHIPCARD_API LOGGERFUNCTIONLOG Logger_SetLogFunction(LOGGERFUNCTIONLOG fn);
00142 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 
00148 #endif /* #ifndef CH_LOGGER_H */
00149 
00150 

Generated on Fri Dec 3 23:10:24 2004 for libchipcard by  doxygen 1.3.9.1