| 37 | QtMessageHandler originalHandler = nullptr; |
| 38 | |
| 39 | void log_handler(QtMsgType type, const QMessageLogContext& context, const QString& msg) { |
| 40 | #if _DEBUG |
| 41 | QString message = qFormatLogMessage(type, context, msg); |
| 42 | std::string printable_message = qPrintable(message); |
| 43 | switch (type) { |
| 44 | default: |
| 45 | fprintf(stdout, "%s\n", printable_message.c_str()); |
| 46 | fflush(stdout); |
| 47 | break; |
| 48 | case QtCriticalMsg: |
| 49 | case QtFatalMsg: |
| 50 | fprintf(stderr, "%s\n", printable_message.c_str()); |
| 51 | fflush(stderr); |
| 52 | break; |
| 53 | } |
| 54 | |
| 55 | if (originalHandler) { |
| 56 | (*originalHandler)(type, context, msg); |
| 57 | } |
| 58 | #else |
| 59 | (void)type; |
| 60 | (void)context; |
| 61 | (void)msg; |
| 62 | #endif //_DEBUG |
| 63 | } |
| 64 | |
| 65 | int main(int argc, char* argv[]) { |
| 66 | QCoreApplication::setOrganizationName("LunarG"); |
nothing calls this directly
no outgoing calls
no test coverage detected