Loading...
Searching...
No Matches
WasmLogging.hpp
1#pragma once
2
3// Message output for the WebAssembly build.
4//
5// On wasm every log line written through stdio is an fprintf that reaches JS one
6// character at a time (fiprintf -> vfiprintf -> __stdio_write -> _fd_write ->
7// doWritev -> write -> put_char), and the browser captures a stack for each one.
8// A runaway warning therefore does not merely fill the console, it makes DevTools
9// unresponsive. This writes whole lines straight to console.* instead, and
10// collapses consecutive identical messages syslog-style.
11
12#include <QtGlobal>
13
14class QMessageLogContext;
15class QString;
16
17namespace score::wasm
18{
24void logMessage(QtMsgType type, const QMessageLogContext& context, const QString& msg);
25
27bool lastMessageWasSuppressed() noexcept;
28}