Serial-TCP/IPbridge  1.0
debug.h
Go to the documentation of this file.
1 
12 #ifndef DEBUG_H
13 #define DEBUG_H
14 
15 #include <iostream>
16 
17 /*
18  * NOTE: Debugging can be enabled/disabled in the Makefile.
19  */
20 
21 // Standard debugging
22 #ifdef DEBUG
23  #if DEBUG == 0
24  // Disable debugging
25  #ifndef NDEBUG
26  #define NDEBUG
27  #endif
28  #endif
29 #endif
30 #include <cassert>
31 
37 inline void logDebugMessage(const std::string &debugMessage) {
38  #if DEBUG
39  std::cerr << "[debug]: " << debugMessage << std::endl;
40  #else
41  (void) debugMessage; // To get rid of the "unused variable" warning
42  #endif
43 }
44 
45 #endif // #ifndef DEBUG_H
46 
47 // End of file debug.h
void logDebugMessage(const std::string &debugMessage)
Logs the selected debugging message.
Definition: debug.h:37