9 #include "sandesh/sandesh_trace.h"
11 #define XMPP_MESSAGE_TRACE_BUF "XmppMessageTrace"
12 #define XMPP_TRACE_BUF "XmppTrace"
14 #define XMPP_PEER_DIR_OUT "SEND"
15 #define XMPP_PEER_DIR_IN "RECV"
16 #define XMPP_PEER_DIR_NA ""
18 #define XMPP_ERROR(obj, ...) \
20 if (LoggingDisabled()) break; \
21 obj::Send(g_vns_constants.CategoryNames.find(Category::XMPP)->second, \
22 SandeshLevel::SYS_ERR, __FILE__, __LINE__, ##__VA_ARGS__); \
27 #define XMPP_ALERT(obj, ...) \
29 if (LoggingDisabled()) break; \
30 obj::Send(g_vns_constants.CategoryNames.find(Category::XMPP)->second, \
31 SandeshLevel::SYS_ALERT, __FILE__, __LINE__, ##__VA_ARGS__); \
32 XMPP_TRACE(obj##Trace, ##__VA_ARGS__); \
35 #define XMPP_WARNING(obj, ...) \
37 if (LoggingDisabled()) break; \
38 obj::Send(g_vns_constants.CategoryNames.find(Category::XMPP)->second, \
39 SandeshLevel::SYS_WARN, __FILE__, __LINE__, ##__VA_ARGS__); \
40 XMPP_TRACE(obj##Trace, ##__VA_ARGS__); \
43 #define XMPP_NOTICE(obj, ...) \
45 if (LoggingDisabled()) break; \
46 obj::Send(g_vns_constants.CategoryNames.find(Category::XMPP)->second, \
47 SandeshLevel::SYS_NOTICE, __FILE__, __LINE__, ##__VA_ARGS__); \
48 XMPP_TRACE(obj##Trace, ##__VA_ARGS__); \
51 #define XMPP_INFO(obj, ...) \
53 if (LoggingDisabled()) break; \
54 obj::Send(g_vns_constants.CategoryNames.find(Category::XMPP)->second, \
55 SandeshLevel::SYS_INFO, __FILE__, __LINE__, ##__VA_ARGS__); \
56 XMPP_TRACE(obj##Trace, ##__VA_ARGS__); \
59 #define XMPP_DEBUG(obj, ...) \
61 if (LoggingDisabled()) break; \
62 obj::Send(g_vns_constants.CategoryNames.find(Category::XMPP)->second, \
63 SandeshLevel::SYS_DEBUG, __FILE__, __LINE__, ##__VA_ARGS__); \
64 XMPP_TRACE(obj##Trace, ##__VA_ARGS__); \
67 #define XMPP_UTDEBUG(obj, ...) \
69 if (LoggingDisabled()) break; \
70 obj::Send(g_vns_constants.CategoryNames.find(Category::XMPP)->second, \
71 Sandesh::LoggingUtLevel(), __FILE__, __LINE__, ##__VA_ARGS__); \
74 #define XMPP_TRACE(obj, ...) do { \
75 obj::TraceMsg(XmppTraceBuf, __FILE__, __LINE__, ##__VA_ARGS__); \
78 #define XMPP_MESSAGE_TRACE(obj, ...) do { \
79 if (LoggingDisabled()) break; \
80 obj::TraceMsg(XmppMessageTraceBuf, __FILE__, __LINE__, ##__VA_ARGS__); \
83 #define XMPP_CONNECTION_LOG_MSG(info) \
85 if (LoggingDisabled()) break; \
86 XMPP_CONNECTION_LOG_SEND(info); \
89 #endif // __XMPP_LOG_H__
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
SandeshTraceBufferPtr XmppMessageTraceBuf
SandeshTraceBufferPtr XmppTraceBuf