- added iStaticServiceInformation
[enigma2.git] / 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 enum { lvlDebug=1, lvlWarning=2, lvlFatal=4 };
13
14 #ifndef SWIG
15 extern Signal2<void, int, const std::string&> logOutput;
16 extern int logOutputConsole;
17 #endif
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 #ifndef SWIG
28     #define ASSERT(x) { if (!(x)) eFatal("%s:%d ASSERTION %s FAILED!", __FILE__, __LINE__, #x); }
29 #endif
30 #else
31     inline void eDebug(const char* fmt, ...)
32     {
33     }
34
35     inline void eDebugNoNewLine(const char* fmt, ...)
36     {
37     }
38
39     inline void eWarning(const char* fmt, ...)
40     {
41     }
42     #define ASSERT(x) do { } while (0)
43 #endif //DEBUG
44
45 #endif // __E_ERROR__