MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / logCallback

Method logCallback

pcsx2-qt/LogWindow.cpp:275–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void LogWindow::logCallback(LOGLEVEL level, ConsoleColors color, std::string_view message)
276{
277 std::unique_lock lock(s_log_mutex);
278 if (!g_log_window)
279 return;
280
281 // I don't like the memory allocations here either...
282 QString qmessage;
283 qmessage.reserve(message.length() + 1);
284 qmessage.append(QUtf8StringView(message.data(), message.length()));
285 qmessage.append(QChar('\n'));
286
287 if (g_emu_thread->isOnUIThread())
288 {
289 g_log_window->appendMessage(static_cast<u32>(level), static_cast<u32>(color), qmessage);
290 }
291 else
292 {
293 QMetaObject::invokeMethod(g_log_window, "appendMessage", Qt::QueuedConnection,
294 Q_ARG(quint32, static_cast<u32>(level)), Q_ARG(quint32, static_cast<u32>(color)),
295 Q_ARG(const QString&, qmessage));
296 }
297}
298
299void LogWindow::closeEvent(QCloseEvent* event)
300{

Callers

nothing calls this directly

Calls 6

isOnUIThreadMethod · 0.80
appendMessageMethod · 0.80
reserveMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected