TransportDebug.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_TRANSPORT_DEBUG_H
00009 #define OPENDDS_TRANSPORT_DEBUG_H
00010 
00011 #include "dds/DCPS/dcps_export.h"
00012 
00013 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00014 #pragma once
00015 #endif /* ACE_LACKS_PRAGMA_ONCE */
00016 
00017 // Build debug level
00018 #ifndef DDS_BLD_DEBUG_LEVEL
00019 
00020 // Log range: 0 < 5 for log message
00021 // Log level 6 will output extensive trace message.
00022 #define DDS_BLD_DEBUG_LEVEL 5
00023 #endif
00024 
00025 // backwards compatibility macros
00026 #define DDS_RUN_DEBUG_LEVEL OpenDDS::DCPS::Transport_debug_level
00027 #define TURN_ON_VERBOSE_DEBUG DDS_RUN_DEBUG_LEVEL = DDS_BLD_DEBUG_LEVEL;
00028 #define TURN_OFF_VERBOSE_DEBUG DDS_RUN_DEBUG_LEVEL = 0;
00029 
00030 /*
00031   This is the only debug macro you should be using.
00032   LEVEL = [0-5], 0 being lowest
00033 */
00034 #define VDBG_LVL(DBG_ARGS, LEVEL) \
00035   if (LEVEL < OpenDDS::DCPS::Transport_debug_level) ACE_DEBUG(DBG_ARGS);
00036 #define VDBG(DBG_ARGS) \
00037   VDBG_LVL(DBG_ARGS, 5)
00038 
00039 namespace OpenDDS {
00040 namespace DCPS {
00041 
00042 /// Transport Logging verbosity level.
00043 // This needs to be initialized somewhere.
00044 extern OpenDDS_Dcps_Export unsigned int Transport_debug_level;
00045 
00046 } // namespace OpenDDS
00047 } // namespace DCPS
00048 
00049 #endif /* OPENDDS_TRANSPORT_DEBUG_H */

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7