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

loggingACEMACROS.h

Go to the documentation of this file.
00001 #ifndef logging_ace_macros_H
00002 #define logging_ace_macros_H
00003 /*******************************************************************************
00004 * ALMA - Atacama Large Millimiter Array
00005 * (c) UNSPECIFIED - FILL IN, 2005 
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; either
00010 * version 2.1 of the License, or (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 *
00021 * "@(#) $Id: loggingACEMACROS.h,v 1.12 2011/03/25 23:42:00 javarias Exp $"
00022 *
00023 * who       when      what
00024 * --------  --------  ----------------------------------------------
00025 * dfugate  2005-04-25  created
00026 */
00027 
00028 #ifndef __cplusplus
00029 #error This is a C++ include file and cannot be used from plain C
00030 #endif
00031 
00032 #include "loggingMACROS.h"
00033 #include <ace/Log_Record.h>
00034 #include "loggingLogSvcHandler.h"
00035 #include "loggingLoggingProxy.h"
00036 #include "loggingACSLogger.h"
00037 
00038 #ifndef ENABLE_LOG4CPP_MACROS
00039 
00048 //-----------------------------------------------------------------------------
00053 #define ACS_CHECK_LOGGER \
00054 if (Logging::Logger::getGlobalLogger() == 0) \
00055 {  \
00056    Logging::Logger::LoggerSmartPtr loggersp(new Logging::ACSLogger(Logging::BaseLog::GLOBAL_LOGGER_NAME)); \
00057    Logging::Logger::setGlobalLogger(loggersp); \
00058 }
00059 
00069 #define ACS_DEBUG(routine, text) \
00070 ACS_CHECK_LOGGER; \
00071 LOG(Logging::ace2acsPriority(LM_DEBUG), routine, text);
00072 
00078 #define ACS_STATIC_DEBUG(routine, text) \
00079 ACS_CHECK_LOGGER; \
00080 STATIC_LOG(Logging::ace2acsPriority(LM_DEBUG), routine, text);
00081 //-----------------------------------------------------------------------------
00095 #define ACS_DEBUG_PARAM(routine, text, param) \
00096 { \
00097     ACS_CHECK_LOGGER; \
00098     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00099     tStruct = Logging::LogSvcHandler::unformatted2formatted(LM_DEBUG, \
00100                                                             text, \
00101                                                             param); \
00102     LOG(tStruct.priority, routine, tStruct.message); \
00103 }
00104 
00110 #define ACS_STATIC_DEBUG_PARAM(routine, text, param) \
00111 { \
00112     ACS_CHECK_LOGGER; \
00113     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00114     tStruct = Logging::LogSvcHandler::unformatted2formatted(LM_DEBUG, \
00115                                                             text, \
00116                                                             param); \
00117     STATIC_LOG(tStruct.priority, routine, tStruct.message); \
00118 }
00119 //-----------------------------------------------------------------------------
00128 #define ACS_TRACE(routine) \
00129 ACS_CHECK_LOGGER; \
00130 LOG(Logging::ace2acsPriority(LM_TRACE), routine, Logging::BaseLog::FIELD_UNAVAILABLE);
00131 
00137 #define ACS_STATIC_TRACE(routine) \
00138 ACS_CHECK_LOGGER; \
00139 STATIC_LOG(Logging::ace2acsPriority(LM_TRACE), routine, Logging::BaseLog::FIELD_UNAVAILABLE);
00140 //-----------------------------------------------------------------------------
00154 #define ACS_SHORT_LOG(X) \
00155 { \
00156     ACS_CHECK_LOGGER; \
00157     LoggingProxy::Flags(LM_FULL_INFO); \
00158     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00159     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00160     LOG(tStruct.priority, Logging::BaseLog::FIELD_UNAVAILABLE, tStruct.message); \
00161 }
00162 
00168 #define ACS_STATIC_SHORT_LOG(X) \
00169 { \
00170     ACS_CHECK_LOGGER; \
00171     LoggingProxy::Flags(LM_FULL_INFO); \
00172     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00173     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00174     STATIC_LOG(tStruct.priority, Logging::BaseLog::FIELD_UNAVAILABLE, tStruct.message); \
00175 }
00176 //-----------------------------------------------------------------------------
00197 #define ACS_LOG(flags, routine, X) \
00198 { \
00199     ACS_CHECK_LOGGER; \
00200     LoggingProxy::Flags(flags); \
00201     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00202     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00203     LOG(tStruct.priority, routine, tStruct.message); \
00204 }
00205 
00211 #define ACS_STATIC_LOG(flags, routine, X) \
00212 { \
00213     ACS_CHECK_LOGGER; \
00214     LoggingProxy::Flags(flags); \
00215     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00216     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00217     STATIC_LOG(tStruct.priority, routine, tStruct.message); \
00218 }
00219 //-----------------------------------------------------------------------------
00237 #define ACS_LOG_TIME(flags, tStamp, routine, _log) \
00238 { \
00239     ACS_CHECK_LOGGER; \
00240     LoggingProxy::Flags(flags); \
00241     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00242     tStruct = Logging::LogSvcHandler::unformatted2formatted _log; \
00243     LOG_RECORD(tStruct.priority, tStruct.message, __FILE__, __LINE__, routine, tStamp, getLogger()->getName()); \
00244 }
00245 
00250 #define LM_PRIORITY(p) p
00251 
00253 #define LM_MAX_PRIORITY 0x0F
00254 
00255 #else
00256 #include "loggingLog4cppACEMACROS.h"
00257 #endif
00258 
00259 #endif 

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