aboutsummaryrefslogtreecommitdiffstats
path: root/include/debugtools.h
blob: 1b34a2e4f00a14e1c3436b25b00933a7ac6f444e (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
#ifndef DEBUGTOOLS_H
#define DEBUGTOOLS_H

#ifdef QT_NO_DEBUG

#define debug_msg(msg)
#define debug_err(msg)

#else
#include <iostream>

#define debug_msg(msg) \
do { \
    std::cout << "DEBUG [" \
              << __FILE__ << " @ " << __LINE__ \
              << "]: " << msg << std::endl; \
} while (0)

#define debug_err(msg) \
do { \
    std::cerr << "ERROR [" \
              << __FILE__ << " @ " << __LINE__ \
              << "]: " << msg << std::endl; \
} while (0)

#endif // QT_NO_DEBUG
#endif // DEBUGTOOLS_H