void myMessageHandler( QtMsgType type, const char * msg ){ switch ( type ) { case QtDebugMsg: break; case QtWarningMsg: break; case QtCriticalMsg: break; case QtFatalMsg: break; }}...qInstallMsgHandler( myMessageHandler );
void MessageHandler(QtMsgType type, const char *msg){ QByteArray str; switch (type) { case QtDebugMsg: str = "Debug: "; break; case QtWarningMsg: str = "Warning: "; break; case QtCriticalMsg: str = "Critical: "; break; case QtFatalMsg: str = "Fatal: "; // << --- Сдесь ставим точку перехвата =) abort(); } str += msg; str += "\r\n"; pMsgFile->write(str); pMsgFile->flush();}
void qt_message_output(QtMsgType msgType, const char *buf)
#include <windows.h>void MessageHandler(QtMsgType type, const char *msg){ QByteArray str; switch (type) { case QtDebugMsg: str = "Debug: "; break; case QtWarningMsg: str = "Warning: "; break; case QtCriticalMsg: str = "Critical: "; break; case QtFatalMsg: str = "Fatal: "; } str += msg; str += "\r\n"; pMsgFile->write(str); pMsgFile->flush(); QString wstr(str); OutputDebugString((WCHAR*)wstr.constData()); if(type == QtFatalMsg) { pMsgFile->close(); asm("int $0x3"); abort(); }}