1 /*! 2 @file 3 @author Albert Semenov 4 @date 06/2009 5 */ 6 7 #ifndef MYGUI_OGRE_DIAGNOSTIC_H_ 8 #define MYGUI_OGRE_DIAGNOSTIC_H_ 9 10 #include "MyGUI_Prerequest.h" 11 12 #define MYGUI_PLATFORM_LOG_SECTION "Platform" 13 #define MYGUI_PLATFORM_LOG_FILENAME "MyGUI.log" 14 #define MYGUI_PLATFORM_LOG(level, text) MYGUI_LOGGING(MYGUI_PLATFORM_LOG_SECTION, level, text) 15 16 #define MYGUI_PLATFORM_EXCEPT(dest) \ 17 { \ 18 MYGUI_PLATFORM_LOG(Critical, dest); \ 19 std::ostringstream stream; \ 20 stream << dest << "\n"; \ 21 MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \ 22 } 23 24 #define MYGUI_PLATFORM_ASSERT(exp, dest) \ 25 { \ 26 if ( ! (exp) ) \ 27 { \ 28 MYGUI_PLATFORM_LOG(Critical, dest); \ 29 std::ostringstream stream; \ 30 stream << dest << "\n"; \ 31 MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \ 32 } \ 33 } 34 35 #endif // MYGUI_OGRE_DIAGNOSTIC_H_ 36