mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Expose full logging to UI layer, pipe Qt messages etc into main logs
This commit is contained in:
@@ -30,9 +30,27 @@
|
||||
#include "Code/CaptureContext.h"
|
||||
#include "Windows/MainWindow.h"
|
||||
|
||||
void sharedLogOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||
{
|
||||
LogMessageType logtype = eLogType_Comment;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case QtDebugMsg: logtype = eLogType_Debug; break;
|
||||
case QtInfoMsg: logtype = eLogType_Comment; break;
|
||||
case QtWarningMsg: logtype = eLogType_Warning; break;
|
||||
case QtCriticalMsg: logtype = eLogType_Error; break;
|
||||
case QtFatalMsg: logtype = eLogType_Fatal; break;
|
||||
}
|
||||
|
||||
RENDERDOC_LogMessage(logtype, "QTRD", context.file, context.line, msg.toUtf8().data());
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
RENDERDOC_LogText("QRenderDoc initialising.");
|
||||
qInstallMessageHandler(sharedLogOutput);
|
||||
|
||||
qInfo() << "QRenderDoc initialising.";
|
||||
|
||||
QString filename = "";
|
||||
bool temp = false;
|
||||
|
||||
Reference in New Issue
Block a user