summaryrefslogtreecommitdiff
path: root/SDL_Core/src/thirdPartyLibs/MessageBroker/src/lib_messagebroker/libMBDebugHelper.h
blob: 0d5260cdda8be50c451ee1779518eb30a012c71e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
 * \file libMBDebugHelper.h
 * \brief DebugHelper.
 * \author AKara
 */

#ifndef MB_DEBUG_HELPER_H
#define MB_DEBUG_HELPER_H

#include <cstdio>

/**
* \def DEBUG_MB_ON
* \brief Switches on MessageBroker debug messages.
*/
#ifdef DEBUG_MB_ON

/**
* \def DBG_MSG
* \brief Debug message output with file name and line number.
* \param x formatted debug message.
* \return printf construction.
*/ 
#define DBG_MSG(x) printf("%s:%d_lib ", __FILE__, __LINE__);\
                   printf x

/**
 * \def DBG_MSG_ERROR
 * \brief Debug ERROR message output with file name and line number.
 * \param x formatted debug message.
 * \return printf construction.
 */
#define DBG_MSG_ERROR(x) printf("ERROR!!! %s:%d_lib ", __FILE__, __LINE__);\
                         printf x

#else

#define DBG_MSG(x)
#define DBG_MSG_ERROR(x)

#endif

#endif /*MB_DEBUG_HELPER_H*/