00001 /* 00002 * liblogger - copyright 2007, Vineeth Neelakant, nvineeth@gmail.com 00003 * This file is part of liblogger. 00004 * 00005 * liblogger is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU Lesser General Public License as published by 00007 * the Free Software Foundation; either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * liblogger is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 #ifndef __LOGGER_OBJECT_H__ 00019 #define __LOGGER_OBJECT_H__ 00020 #include <stdarg.h> 00021 #include <stdio.h> 00022 #include <liblogger/liblogger.h> 00023 00024 /* fwd declaration. */ 00025 struct LogWriter; 00026 typedef int (*Log)(struct LogWriter* _this,const LogLevel logLevel, 00027 #ifdef VARIADIC_MACROS 00028 const char* moduleName, 00029 const char* file,const char* funcName, const int lineNum, 00030 #endif 00031 const char* fmt,va_list ap); 00032 typedef int (*LogFuncEntry)(struct LogWriter * _this,const char* funcName); 00033 typedef int (*LogFuncExit)(struct LogWriter* _this,const char* funcName,int lineNum); 00034 typedef int (*LoggerDeInit)(struct LogWriter* _this); 00035 00036 /** The log writer object */ 00037 typedef struct LogWriter 00038 { 00039 /** Member function to log. */ 00040 Log log; 00041 /** Member function to log the function entry. */ 00042 LogFuncEntry logFuncEntry; 00043 /** Member function to log the function exit. */ 00044 LogFuncExit logFuncExit; 00045 /** Member function to deinitialize the log writer object, the log writer object will 00046 * not be referenced after this call.*/ 00047 LoggerDeInit loggerDeInit; 00048 }LogWriter; 00049 00050 00051 #endif // __LOGGER_OBJECT_H__