• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

loggingLog4cppMACROS.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * ALMA - Atacama Large Millimiter Array
00003 * (c) Associated Universities Inc., 2005
00004 *
00005 * This library is free software; you can redistribute it and/or
00006 * modify it under the terms of the GNU Lesser General Public
00007 * License as published by the Free Software Foundation; either
00008 * version 2.1 of the License, or (at your option) any later version.
00009 *
00010 * This library 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 GNU
00013 * Lesser General Public License for more details.
00014 *
00015 * You should have received a copy of the GNU Lesser General Public
00016 * License along with this library; if not, write to the Free Software
00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00018 *
00019 * "@(#) $Id: loggingLog4cppMACROS.h,v 1.3 2011/03/23 23:27:48 javarias Exp $"
00020 */
00021 
00022 #ifndef LOGGING_MACROS_H_
00023 #define LOGGING_MACROS_H_
00024 
00025 #ifdef ENABLE_LOG4CPP_MACROS
00026 
00027 #include "loggingLog4cpp.h"
00028 #include "loggingACSLoggingEvent.h"
00029 
00030 #include <acscommonC.h>
00031 
00032 #include <memory>
00033 
00034 #define LOG(priority, routine, text) \
00035         LOGGER_FACTORY->getGlobalLogger()->log(text, priority, routine, __FILE__, __LINE__, \
00036                         "", "", "", "", "", "", "", 0, "");
00037 
00038 #define LOG_FULL(logPriority, logRoutine, logMessage, logAudience, logArray, logAntenna) \
00039                 LOGGER_FACTORY->getGlobalLogger()->log(logMessage, logging::convertPriority(logPriority), logRoutine , __FILE__, __LINE__, \
00040                                 "", "", logAudience, "", logArray, logAntenna, "", 0, "");
00041 
00042 #define LOG_WITH_ANTENNA_CONTEXT(logPriority, logRoutine, logMessage, logArray, logAntenna) \
00043                 LOGGER_FACTORY->getGlobalLogger()->log(logMessage, logging::convertPriority(logPriority), logRoutine , __FILE__, __LINE__, \
00044                                 "", "", "", "", logArray, logAntenna, "", 0, "");
00045 
00046 #define LOG_TO_AUDIENCE(logPriority, logRoutine, logMessage, logAudience) \
00047                 LOGGER_FACTORY->getGlobalLogger()->log(logMessage, logging::convertPriority(logPriority), logRoutine , __FILE__, __LINE__, \
00048                                 "", "", logAudience, "", "", "", "", 0, "");
00049 
00050 #define LOG_RECORD(logPriority, logMessage, logFile, logLine, logRoutine, logSource) \
00051                 LOGGER_FACTORY->getLogger(logSource)->log(logMessage, logging::convertPriority(logPriority), logRoutine , logFile, logLine, \
00052                                 "", "", "", "", "", "", "", 0, "");
00053 
00054 #define LOG_GLOBAL_RECORD(logPriority, logMessage, logFile, logLine, logRoutine, logTime) \
00055                 LOGGER_FACTORY->getGlobalLogger()->log(logMessage, logging::convertPriority(logPriority), logRoutine , logFile, logLine, \
00056                                 "", "", "", "", "", "", "", 0, "");
00057 
00058 #define STATIC_LOG(priority, routine, text) \
00059                 LOGGER_FACTORY->getStaticLogger()->log(text, logging::convertPriority(priority), routine, __FILE__, __LINE__, \
00060                                 "", "", "", "", "", "", "", 0, "");
00061 
00062 #define STATIC_LOG_RECORD(logPriority, logMessage, logFile, logLine, logRoutine, logTime) \
00063                 LOGGER_FACTORY->getStaticLogger()->log(logMessage, logging::convertPriority(logPriority), logRoutine , logFile, logLine, \
00064                                 "", "", "", "", "", "", "", 0, "");
00065 
00066 #define STATIC_LOG_TO_AUDIENCE(priority, routine, text, logAudience) \
00067                 LOGGER_FACTORY->getStaticLogger()->log(text, logging::convertPriority(priority), routine, __FILE__, __LINE__, \
00068                                 "", "", logAudience, "", "", "", "", 0, "");
00069 
00070 #define AUTO_TRACE(routine) \
00071                 std::auto_ptr<logging::LogTrace> __x_logging__auto_trace__routine (new logging::LogTrace(LOGGER_FACTORY->getGlobalLogger(), routine, __FILE__, __LINE__));
00072 
00073 #define AUTO_STATIC_TRACE(routine) \
00074                 std::auto_ptr<logging::LogTrace>(new logging::LogTrace(LOGGER_FACTORY->getStaticLogger(), routine, __FILE__, __LINE__));
00075 
00076 #define LOG_TO_DEVELOPER(logPriority, logMessage) \
00077                 LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::DEVELOPER);
00078 
00079 #define STATIC_LOG_TO_DEVELOPER(logPriority, logMessage) \
00080                 STATIC_LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::DEVELOPER);
00081 
00082 #define LOG_TO_OPERATOR( logPriority, logMessage) \
00083                 LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::OPERATOR);
00084 
00085 #define STATIC_LOG_TO_OPERATOR( logPriority, logMessage) \
00086                 STATIC_LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::OPERATOR);
00087 
00088 #define LOG_TO_SCIENCE( logPriority, logMessage) \
00089                 LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::SCILOG);
00090 
00091 #define STATIC_LOG_TO_SCIENCE( logPriority, logMessage) \
00092                 STATIC_LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::SCILOG);
00093 
00094 #define LOG_TO_SCILOG( logPriority, logMessage) \
00095                 LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::SCILOG);
00096 
00097 #define STATIC_LOG_TO_SCILOG( logPriority, logMessage) \
00098                 STATIC_LOG_TO_AUDIENCE(logPriority, __PRETTY_FUNCTION__, logMessage, log_audience::SCILOG);
00099 
00100 #define LOG_TO_AUDIENCE_WITH_LOGGER(logPriority, logMessage, logAudience, logger) \
00101 { \
00102         if (logger != NULL) {\
00103                 logger->log(logMessage, logPriority, __PRETTY_FUNCTION__, __FILE__, __LINE, "", "", logAudience, "", "", "", "", 0, ""); \
00104         }\
00105 }
00106 
00107 #endif
00108 #endif

Generated on Thu Jan 12 2012 23:13:51 for ACS-10.0 C++ API by  doxygen 1.7.0