3 //=============================================================================
9 //=============================================================================
14 #include /**/ "ace/pre.h"
16 #include /**/ "tao/TAO_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include /**/ "tao/Versioned_Namespace.h"
23 #include "ace/Log_Category.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 // These are global to simplify is use by other code, very much in
28 // particular by getopt and related argument-parsing code
30 // THREADING NOTE: don't set them except in an unthreaded environment
31 // such as process initialization. They're treated as immutable.
33 // 0 to ??; higher == more
34 extern TAO_Export
unsigned int TAO_debug_level
;
36 // debug messages on (1) or off (0)
37 extern TAO_Export
unsigned int TAO_orbdebug
;
39 extern TAO_Export ACE_Log_Category TAO_log_category
;
41 TAO_END_VERSIONED_NAMESPACE_DECL
44 #if defined (ACE_NLOGGING)
45 #if !defined (TAOLIB_HEX_DUMP)
46 # define TAOLIB_HEX_DUMP(X) do {} while (0)
48 #if !defined (TAOLIB_ERROR_RETURN)
49 # define TAOLIB_ERROR_RETURN(X, Y) return (Y)
51 #if !defined (TAOLIB_ERROR)
52 # define TAOLIB_ERROR(X) do {} while (0)
54 #if !defined (TAOLIB_DEBUG)
55 # define TAOLIB_DEBUG(X) do {} while (0)
58 #if !defined (TAOLIB_HEX_DUMP)
59 #define TAOLIB_HEX_DUMP(X) \
61 int const __ace_error = ACE_Log_Msg::last_error_adapter (); \
62 ACE_Log_Category_TSS *ace___ = TAO_VERSIONED_NAMESPACE_NAME::TAO_log_category.per_thr_obj(); \
63 if (ace___ == 0) break;\
64 ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \
65 ace___->log_hexdump X; \
68 #if !defined (TAOLIB_ERROR_RETURN)
69 #define TAOLIB_ERROR_RETURN(X, Y) \
71 int const __ace_error = ACE_Log_Msg::last_error_adapter (); \
72 ACE_Log_Category_TSS *ace___ = TAO_VERSIONED_NAMESPACE_NAME::TAO_log_category.per_thr_obj(); \
73 if (ace___ == 0) return Y;\
74 ace___->conditional_set (__FILE__, __LINE__, Y, __ace_error); \
79 #if !defined (TAOLIB_ERROR)
80 #define TAOLIB_ERROR(X) \
82 int const __ace_error = ACE_Log_Msg::last_error_adapter (); \
83 ACE_Log_Category_TSS *ace___ = TAO_VERSIONED_NAMESPACE_NAME::TAO_log_category.per_thr_obj(); \
84 if (ace___ == 0) break;\
85 ace___->conditional_set (__FILE__, __LINE__, -1, __ace_error); \
89 #if !defined (TAOLIB_DEBUG)
90 #define TAOLIB_DEBUG(X) \
92 int const __ace_error = ACE_Log_Msg::last_error_adapter (); \
93 ACE_Log_Category_TSS *ace___ = TAO_VERSIONED_NAMESPACE_NAME::TAO_log_category.per_thr_obj(); \
94 if (ace___ == 0) break;\
95 ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \
99 #endif /* ACE_NLOGGING */
101 #include /**/ "ace/post.h"
102 #endif /* TAO_DEBUG_H */