OpenDDS  Snapshot(2023/04/28-20:55)
TransportDebug.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_FRAMEWORK_TRANSPORTDEBUG_H
9 #define OPENDDS_DCPS_TRANSPORT_FRAMEWORK_TRANSPORTDEBUG_H
10 
11 #include "dds/DCPS/dcps_export.h"
12 
13 #if !defined (ACE_LACKS_PRAGMA_ONCE)
14 #pragma once
15 #endif /* ACE_LACKS_PRAGMA_ONCE */
16 
17 // Build debug level
18 #ifndef DDS_BLD_DEBUG_LEVEL
19 
20 // Log range: 0 < 5 for log message
21 // Log level 6 will output extensive trace message.
22 #define DDS_BLD_DEBUG_LEVEL 5
23 #endif
24 
25 // backwards compatibility macros
26 #define DDS_RUN_DEBUG_LEVEL OpenDDS::DCPS::Transport_debug_level
27 #define TURN_ON_VERBOSE_DEBUG DDS_RUN_DEBUG_LEVEL = DDS_BLD_DEBUG_LEVEL;
28 #define TURN_OFF_VERBOSE_DEBUG DDS_RUN_DEBUG_LEVEL = 0;
29 
30 /*
31  This is the only debug macro you should be using.
32  LEVEL = [0-5], 0 being lowest
33 */
34 #define VDBG_LVL(DBG_ARGS, LEVEL) \
35  if (LEVEL < OpenDDS::DCPS::Transport_debug_level) ACE_DEBUG(DBG_ARGS);
36 #define VDBG(DBG_ARGS) \
37  VDBG_LVL(DBG_ARGS, 5)
38 
40 
41 namespace OpenDDS {
42 namespace DCPS {
43 
44 /// Transport Logging verbosity level.
45 // This needs to be initialized somewhere.
46 extern OpenDDS_Dcps_Export unsigned int Transport_debug_level;
47 
49 public:
51 
52  /// Log all RTPS messages sent or recieved.
54  /// Log progress for RTPS entity discovery and association.
56  /// Log received RTPS messages that were dropped.
58  /**
59  * Log non-final RTPS messages send or received. Useful to gauge lost
60  * messages and resends.
61  */
63  /**
64  * Log message fragment reassembly process for transports where that applies.
65  * Also logged when the transport debug level is set to the most verbose.
66  */
68  /// Log number of associations and pending associations of RTPS entities.
70 };
72 
73 } // namespace DCPS
74 } // namespace OpenDDS
75 
77 
78 #endif /* OPENDDS_TRANSPORT_DEBUG_H */
OpenDDS_Dcps_Export TransportDebug transport_debug
Definition: debug.cpp:26
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
bool log_dropped_messages
Log received RTPS messages that were dropped.
OpenDDS_Dcps_Export unsigned int Transport_debug_level
Transport Logging verbosity level.
Definition: debug.cpp:25
bool log_remote_counts
Log number of associations and pending associations of RTPS entities.
bool log_messages
Log all RTPS messages sent or recieved.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
bool log_progress
Log progress for RTPS entity discovery and association.