• 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.10 2006/10/04 14:18:41 gchiozzi 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 <ace/Log_Record.h>
00033 #include "loggingMACROS.h"
00034 #include "loggingLogSvcHandler.h"
00035 #include "loggingLoggingProxy.h"
00036 #include "loggingACSLogger.h"
00037 
00046 //-----------------------------------------------------------------------------
00051 #define ACS_CHECK_LOGGER \
00052 if (Logging::Logger::getGlobalLogger() == 0) \
00053 {  \
00054    Logging::Logger::LoggerSmartPtr loggersp(new Logging::ACSLogger(Logging::BaseLog::GLOBAL_LOGGER_NAME)); \
00055    Logging::Logger::setGlobalLogger(loggersp); \
00056 }
00057 
00067 #define ACS_DEBUG(routine, text) \
00068 ACS_CHECK_LOGGER; \
00069 LOG(Logging::ace2acsPriority(LM_DEBUG), routine, text);
00070 
00076 #define ACS_STATIC_DEBUG(routine, text) \
00077 ACS_CHECK_LOGGER; \
00078 STATIC_LOG(Logging::ace2acsPriority(LM_DEBUG), routine, text);
00079 //-----------------------------------------------------------------------------
00093 #define ACS_DEBUG_PARAM(routine, text, param) \
00094 { \
00095     ACS_CHECK_LOGGER; \
00096     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00097     tStruct = Logging::LogSvcHandler::unformatted2formatted(LM_DEBUG, \
00098                                                             text, \
00099                                                             param); \
00100     LOG(tStruct.priority, routine, tStruct.message); \
00101 }
00102 
00108 #define ACS_STATIC_DEBUG_PARAM(routine, text, param) \
00109 { \
00110     ACS_CHECK_LOGGER; \
00111     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00112     tStruct = Logging::LogSvcHandler::unformatted2formatted(LM_DEBUG, \
00113                                                             text, \
00114                                                             param); \
00115     STATIC_LOG(tStruct.priority, routine, tStruct.message); \
00116 }
00117 //-----------------------------------------------------------------------------
00126 #define ACS_TRACE(routine) \
00127 ACS_CHECK_LOGGER; \
00128 LOG(Logging::ace2acsPriority(LM_TRACE), routine, Logging::BaseLog::FIELD_UNAVAILABLE);
00129 
00135 #define ACS_STATIC_TRACE(routine) \
00136 ACS_CHECK_LOGGER; \
00137 STATIC_LOG(Logging::ace2acsPriority(LM_TRACE), routine, Logging::BaseLog::FIELD_UNAVAILABLE);
00138 //-----------------------------------------------------------------------------
00152 #define ACS_SHORT_LOG(X) \
00153 { \
00154     ACS_CHECK_LOGGER; \
00155     LoggingProxy::Flags(LM_FULL_INFO); \
00156     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00157     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00158     LOG(tStruct.priority, Logging::BaseLog::FIELD_UNAVAILABLE, tStruct.message); \
00159 }
00160 
00166 #define ACS_STATIC_SHORT_LOG(X) \
00167 { \
00168     ACS_CHECK_LOGGER; \
00169     LoggingProxy::Flags(LM_FULL_INFO); \
00170     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00171     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00172     STATIC_LOG(tStruct.priority, Logging::BaseLog::FIELD_UNAVAILABLE, tStruct.message); \
00173 }
00174 //-----------------------------------------------------------------------------
00195 #define ACS_LOG(flags, routine, X) \
00196 { \
00197     ACS_CHECK_LOGGER; \
00198     LoggingProxy::Flags(flags); \
00199     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00200     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00201     LOG(tStruct.priority, routine, tStruct.message); \
00202 }
00203 
00209 #define ACS_STATIC_LOG(flags, routine, X) \
00210 { \
00211     ACS_CHECK_LOGGER; \
00212     LoggingProxy::Flags(flags); \
00213     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00214     tStruct = Logging::LogSvcHandler::unformatted2formatted X; \
00215     STATIC_LOG(tStruct.priority, routine, tStruct.message); \
00216 }
00217 //-----------------------------------------------------------------------------
00235 #define ACS_LOG_TIME(flags, tStamp, routine, _log) \
00236 { \
00237     ACS_CHECK_LOGGER; \
00238     LoggingProxy::Flags(flags); \
00239     Logging::LogSvcHandler::DeprecatedLogInfo tStruct; \
00240     tStruct = Logging::LogSvcHandler::unformatted2formatted _log; \
00241     LOG_RECORD(tStruct.priority, tStruct.message, __FILE__, __LINE__, routine, tStamp, getLogger()->getName()); \
00242 }
00243 
00248 #define LM_PRIORITY(p) p
00249 
00251 #define LM_MAX_PRIORITY 0x0F
00252 
00253 #endif 

Generated on Thu Jul 8 2010 19:47:47 for ACS-9.0 C++ API by  doxygen 1.7.0