ZeroEQ  0.9.0
ZeroEQ - Zero Event Queue
log.h
1 
2 /* Copyright (c) 2014-2015, Human Brain Project
3  * Juan Hernando <jhernando@fi.upm.es>
4  */
5 
6 #ifndef ZEROEQ_LOG_H
7 #define ZEROEQ_LOG_H
8 
9 #include <iostream>
10 #define ZEROEQERROR std::cerr
11 #define ZEROEQWARN std::cerr
12 #ifdef NDEBUG
13 #define ZEROEQINFO \
14  if (false) \
15  std::cout
16 #define ZEROEQLOG \
17  if (false) \
18  std::cout
19 #else
20 #define ZEROEQINFO std::cerr
21 #define ZEROEQLOG std::cerr
22 #endif
23 #define ZEROEQDONTCALL \
24  { \
25  ZEROEQERROR << "Code is not supposed to be called in this context" \
26  << std::endl; \
27  }
28 
29 #define ZEROEQTHROW(exc) \
30  { \
31  ZEROEQINFO << exc.what() << std::endl; \
32  throw exc; \
33  }
34 
35 #endif