import of enigma2
[vuplus_dvbapp] / lib / base / eerror.h
1 #ifndef __E_ERROR__
2 #define __E_ERROR__
3
4 #include "config.h"
5 #include <string>
6 #include <map>       
7 #include <new>
8 #include <libsig_comp.h>
9
10 void eFatal(const char* fmt, ...);
11
12 class eString;
13
14 enum { lvlDebug=1, lvlWarning=2, lvlFatal=4 };
15
16 extern Signal2<void, int, const eString&> logOutput;
17 extern int logOutputConsole;
18
19 #ifdef ASSERT
20 #undef ASSERT
21 #endif
22
23 #ifdef DEBUG
24     void eDebug(const char* fmt, ...);
25     void eDebugNoNewLine(const char* fmt, ...);
26     void eWarning(const char* fmt, ...);
27     #define ASSERT(x) { if (!(x)) eFatal("%s:%d ASSERTION %s FAILED!", __FILE__, __LINE__, #x); }
28 #else
29     inline void eDebug(const char* fmt, ...)
30     {
31     }
32
33     inline void eDebugNoNewLine(const char* fmt, ...)
34     {
35     }
36
37     inline void eWarning(const char* fmt, ...)
38     {
39     }
40     #define ASSERT(x) do { } while (0)
41 #endif //DEBUG
42
43 #endif // __E_ERROR__