MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / log_handler

Function log_handler

vkconfig_cmd/main.cpp:39–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37QtMessageHandler originalHandler = nullptr;
38
39void 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
65int main(int argc, char* argv[]) {
66 QCoreApplication::setOrganizationName("LunarG");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected