Only install our filter once
This commit is contained in:
parent
22bacf09e1
commit
5ae3af6cbf
@ -75,7 +75,9 @@ ScriptEngine::ScriptEngine(DeviceManager *deviceManager, QObject *parent) : QObj
|
|||||||
|
|
||||||
// console.log()/warn() messages instead are printed to the "qml" category. We install our own
|
// console.log()/warn() messages instead are printed to the "qml" category. We install our own
|
||||||
// filter to *always* get them, regardless of the configured logging categories
|
// filter to *always* get them, regardless of the configured logging categories
|
||||||
s_oldCategoryFilter = QLoggingCategory::installFilter(&logCategoryFilter);
|
if (!s_oldCategoryFilter) {
|
||||||
|
s_oldCategoryFilter = QLoggingCategory::installFilter(&logCategoryFilter);
|
||||||
|
}
|
||||||
// and our own handler to redirect them to the ScriptEngine category
|
// and our own handler to redirect them to the ScriptEngine category
|
||||||
if (s_engines.isEmpty()) {
|
if (s_engines.isEmpty()) {
|
||||||
s_upstreamMessageHandler = qInstallMessageHandler(&logMessageHandler);
|
s_upstreamMessageHandler = qInstallMessageHandler(&logMessageHandler);
|
||||||
|
|||||||
Reference in New Issue
Block a user