00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _BASE_WX_WXUTILS_H
00024 #define _BASE_WX_WXUTILS_H
00025
00026 #include <hugin_utils/utils.h>
00027
00028
00029
00030 #ifdef __WXMSW__
00031 #include <wx/string.h>
00032 #include <wx/log.h>
00033
00034 #ifdef DEBUG
00035 #undef DEBUG_TRACE
00036 #undef DEBUG_DEBUG
00037 #undef DEBUG_INFO
00038 #undef DEBUG_NOTICE
00039
00040
00041
00042 #define DEBUG_TRACE(msg) { std::cerr << "TRACE " << DEBUG_HEADER << msg << std::endl; }
00043
00044
00045 #define DEBUG_DEBUG(msg) { std::cerr << "DEBUG " << DEBUG_HEADER << msg << std::endl; }
00046
00047
00048 #define DEBUG_INFO(msg) { std::cerr << "INFO " << DEBUG_HEADER << msg << std::endl; }
00049
00050
00051 #define DEBUG_NOTICE(msg) { std::cerr << "NOTICE " << DEBUG_HEADER << msg << std::endl; }
00052 #endif
00053
00054 #undef DEBUG_WARN
00055 #undef DEBUG_ERROR
00056 #undef DEBUG_FATAL
00057 #undef DEBUG_ASSERT
00058
00059
00060 #define DEBUG_WARN(msg) { std::stringstream o; o << "WARN: " << DEBUG_HEADER << msg; wxLogWarning(wxString(o.str().c_str(), wxConvISO8859_1));}
00061
00062 #define DEBUG_ERROR(msg) { std::stringstream o; o << "ERROR: " << DEBUG_HEADER << msg; wxLogError(wxString(o.str().c_str(),wxConvISO8859_1));}
00063
00064 #define DEBUG_FATAL(msg) { std::stringstream o; o << "FATAL: " << DEBUG_HEADER << "(): " << msg; wxLogError(wxString(o.str().c_str(),wxConvISO8859_1)); }
00065
00066 #define DEBUG_ASSERT(cond) \
00067 do { \
00068 if (!(cond)) { \
00069 std::stringstream o; o << "ASSERTATION: " << DEBUG_HEADER << "(): " << #cond; \
00070 wxLogFatalError(wxString(o.str().c_str(),wxConvISO8859_1)); \
00071 } \
00072 } while(0)
00073 #endif
00074
00075
00076 #endif // _BASE_WX_WXUTILS_H