summaryrefslogtreecommitdiffstats
path: root/src/trace.h
blob: 15d69cbd1ae9e59a1726e109462bd70bb800a982 (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
#ifndef _TRACE_H
#define _TRACE_H

#ifdef ENABLE_TRACING
  extern void INIT_TRACE(void);
  extern void SHOW_TRACE(void);
  extern void DUMP_TRACE(const char *file);
  
  /*
   * Lets admit it, shall we. C macros are sometimes are so much cooler than
   * C++ static inlines ;) 
   * WARNING: fmt has to be a static string
   */
  #define TRACE(fmt,args...) \
        do { tqDebug("~%s - \t" fmt, __PRETTY_FUNCTION__, ##args); } while (0)

  #define SHOW_TRACE_TEXT "Show Trace"
  
#else // !ENABLE_TRACING

  #define INIT_TRACE()
  #define TRACE(fmt, ...)
  #define SHOW_TRACE()
  #define SHOW_TRACE_TEXT TQString::null
  #define DUMP_TRACE(file)

#endif  // ENABLE_TRACING

#endif // _TRACE_H