Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

logger.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *
00003  * Verball Model Storage Library, Common Information Model Library 
00004  * for integration of Intelligent Services.
00005  * Copyright (C) 2005 Nikita Vinokurov, Orgway LLC.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; 
00010  * version 2.1 of the License.
00011  *
00012  * This library 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 GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00020  * Boston, MA  02110-1301  USA
00021  *
00022  * $Id: logger.h,v 1.4 2006/09/18 21:38:32 sbreg Exp $
00023  **********************************************************************/
00024 
00025 #ifndef _LOGGER_H_
00026 #define _LOGGER_H_
00027 #include <stdio.h>
00028 #include <stdarg.h>
00029 
00030 #if defined(_WIN32) || defined(__declspec)
00031 
00032 #   ifdef COMPILE_DLL
00033 #       define LOGGER_STORAGE_TYPE __declspec(dllexport)
00034 #   else
00035 #       define LOGGER_STORAGE_TYPE __declspec(dllimport)
00036 #   endif
00037 
00038 #else // _WIN32 || __declspec
00039 #   define LOGGER_STORAGE_TYPE extern
00040 #endif // _WIN32 || __declspec
00041 
00042 
00046  LOGGER_STORAGE_TYPE void log_error(char *format, ...);
00047 
00051 LOGGER_STORAGE_TYPE void log_debug(char *message, ...);
00052 
00053 LOGGER_STORAGE_TYPE void log_warning(char *message, ...);
00054 
00055 #ifndef __GNUC__
00056 
00057 #ifdef DEBUG
00058 #define LOG_DEBUG log_debug
00059 #else
00060 #define LOG_DEBUG 
00061 #endif
00062 
00063 
00064 #ifdef WARNINGS
00065 #define LOG_WARNING log_warning
00066 #else
00067 #define LOG_WARNING
00068 #endif
00069 
00070 #define LOG_ERROR log_error
00071 
00072 #else/*_WIN32*/
00073 
00074 #ifdef DEBUG
00075 #define LOG_DEBUG(format, ...) fprintf(stderr, "DEBUG: %s : %s: " format "\n", \
00076     __FILE__, __FUNCTION__, ## __VA_ARGS__)
00077 #else
00078 #define LOG_DEBUG
00079 #endif
00080 
00081 
00082 #ifdef WARNINGS
00083 #define LOG_WARNING(format, ...) fprintf(stderr, "WARN: %s : %s: " format "\n", \
00084     __FILE__, __FUNCTION__, ## __VA_ARGS__) 
00085 #else /* WARNINGS */
00086 #define LOG_WARNING
00087 #endif /* WARNINGS */
00088 
00089 
00090 #define LOG_ERROR(format, ...) fprintf(stderr, "ERROR: %s : %s: " format "\n", \
00091     __FILE__, __FUNCTION__, ## __VA_ARGS__) 
00092 
00093 #endif/*_WIN32*/
00094 
00095 #define PRINT_STATEMENT(a, s) fprintf(stderr, "STMTDUMP: %s (%s, %s, %s, %s)\n", (a), s->context.literal, s->predicate.literal, s->subject.literal, s->object.literal)
00096 
00097 #endif
00098 #ifdef DMALLOC
00099 #include<dmalloc.h>
00100 #endif

Generated on Wed Dec 27 16:52:17 2006 for VRB Online Server by  doxygen 1.4.4