From 72ed1add94d5ba55cd8148bd6855668d772d8f04 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 2 Feb 2017 15:08:34 -0800 Subject: [PATCH] CR log spam cleanup --- .../src/AssignmentClientLogging.cpp | 2 +- .../src/AssignmentClientLogging.h | 2 +- .../src/scripts/EntityScriptServer.cpp | 26 ++++++++----------- .../src/scripts/EntityScriptServerLogging.cpp | 14 ++++++++++ .../src/scripts/EntityScriptServerLogging.h | 19 ++++++++++++++ interface/src/EntityScriptServerLogClient.cpp | 3 --- scripts/developer/debugging/essDebugWindow.js | 2 +- 7 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 assignment-client/src/scripts/EntityScriptServerLogging.cpp create mode 100644 assignment-client/src/scripts/EntityScriptServerLogging.h diff --git a/assignment-client/src/AssignmentClientLogging.cpp b/assignment-client/src/AssignmentClientLogging.cpp index 9110dccc5f..73687f94d0 100644 --- a/assignment-client/src/AssignmentClientLogging.cpp +++ b/assignment-client/src/AssignmentClientLogging.cpp @@ -3,7 +3,7 @@ // assignment-client/src // // Created by Clement on 12/14/15. -// Copyright 2015 High Fidelity, Inc. +// Copyright 2017 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/assignment-client/src/AssignmentClientLogging.h b/assignment-client/src/AssignmentClientLogging.h index 88e2add017..144fbe2125 100644 --- a/assignment-client/src/AssignmentClientLogging.h +++ b/assignment-client/src/AssignmentClientLogging.h @@ -3,7 +3,7 @@ // assignment-client/src // // Created by Clement on 12/14/15. -// Copyright 2015 High Fidelity, Inc. +// Copyright 2017 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/assignment-client/src/scripts/EntityScriptServer.cpp b/assignment-client/src/scripts/EntityScriptServer.cpp index e64e2fe3ce..b21b5e9dcd 100644 --- a/assignment-client/src/scripts/EntityScriptServer.cpp +++ b/assignment-client/src/scripts/EntityScriptServer.cpp @@ -11,9 +11,13 @@ #include "EntityScriptServer.h" +#include + #include #include +#include #include +#include #include #include #include @@ -24,13 +28,9 @@ #include #include -#include "ClientServerUtils.h" +#include "EntityScriptServerLogging.h" #include "../entities/AssignmentParentFinder.h" - -#include -#include - using Mutex = std::mutex; using Lock = std::lock_guard; @@ -101,7 +101,7 @@ void EntityScriptServer::handleReloadEntityServerScriptPacket(QSharedPointerread(NUM_BYTES_RFC4122_UUID)); if (_entityViewer.getTree() && !_shuttingDown) { - qDebug() << "Reloading: " << entityID; + qCDebug(entity_script_server) << "Reloading: " << entityID; _entitiesScriptEngine->unloadEntityScript(entityID); checkAndCallPreload(entityID, true); } @@ -191,12 +191,12 @@ void EntityScriptServer::handleEntityServerScriptLogPacket(QSharedPointergetCanRez()) { if (it == std::end(_logListeners)) { _logListeners.insert(senderUUID); - qInfo() << "Node" << senderUUID << "subscribed to log stream"; + qCInfo(entity_script_server) << "Node" << senderUUID << "subscribed to log stream"; } } else { if (it != std::end(_logListeners)) { _logListeners.erase(it); - qInfo() << "Node" << senderUUID << "unsubscribed from log stream"; + qCInfo(entity_script_server) << "Node" << senderUUID << "unsubscribed from log stream"; } } } @@ -226,16 +226,12 @@ void EntityScriptServer::pushLogs() { if (node && node->getActiveSocket()) { auto copy = NLPacket::createCopy(*packet); nodeList->sendPacket(std::move(copy), *node); - } else { - qWarning() << "Node not found"; } } auto node = nodeList->nodeWithUUID(*last); if (node && node->getActiveSocket()) { nodeList->sendPacket(std::move(packet), *node); - } else { - qWarning() << "Node not found"; } } @@ -388,7 +384,7 @@ void EntityScriptServer::handleSelectedAudioFormat(QSharedPointergetName()) { _codec = plugin; _encoder = plugin->createEncoder(AudioConstants::SAMPLE_RATE, AudioConstants::MONO); - qDebug() << "Selected Codec Plugin:" << _codec.get(); + qCDebug(entity_script_server) << "Selected Codec Plugin:" << _codec.get(); break; } } @@ -490,7 +486,7 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, const QString scriptUrl = entity->getServerScripts(); if (!scriptUrl.isEmpty()) { scriptUrl = ResourceManager::normalizeURL(scriptUrl); - qDebug() << "Loading entity server script" << scriptUrl << "for" << entityID; + qCDebug(entity_script_server) << "Loading entity server script" << scriptUrl << "for" << entityID; ScriptEngine::loadEntityScript(_entitiesScriptEngine, entityID, scriptUrl, reload); } } diff --git a/assignment-client/src/scripts/EntityScriptServerLogging.cpp b/assignment-client/src/scripts/EntityScriptServerLogging.cpp new file mode 100644 index 0000000000..7d033d8c9c --- /dev/null +++ b/assignment-client/src/scripts/EntityScriptServerLogging.cpp @@ -0,0 +1,14 @@ +// +// EntityScriptServerLogging.cpp +// assignment-client/src/scripts +// +// Created by Clement on 2/2/17. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "EntityScriptServerLogging.h" + +Q_LOGGING_CATEGORY(entity_script_server, "hifi.entity-script-server") \ No newline at end of file diff --git a/assignment-client/src/scripts/EntityScriptServerLogging.h b/assignment-client/src/scripts/EntityScriptServerLogging.h new file mode 100644 index 0000000000..efb0c70cd0 --- /dev/null +++ b/assignment-client/src/scripts/EntityScriptServerLogging.h @@ -0,0 +1,19 @@ +// +// EntityScriptServerLogging.h +// assignment-client/src/scripts +// +// Created by Clement on 2/2/17. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_EntityScriptServerLogging_h +#define hifi_EntityScriptServerLogging_h + +#include + +Q_DECLARE_LOGGING_CATEGORY(entity_script_server) + +#endif // hifi_EntityScriptServerLogging_h \ No newline at end of file diff --git a/interface/src/EntityScriptServerLogClient.cpp b/interface/src/EntityScriptServerLogClient.cpp index e02bd6cb5c..4405af5b1b 100644 --- a/interface/src/EntityScriptServerLogClient.cpp +++ b/interface/src/EntityScriptServerLogClient.cpp @@ -33,7 +33,6 @@ void EntityScriptServerLogClient::disconnectNotify(const QMetaMethod& signal) { } void EntityScriptServerLogClient::connectionsChanged() { - qDebug() << Q_FUNC_INFO << _subscribed << receivers(SIGNAL(receivedNewLogLines(QString))); auto numReceivers = receivers(SIGNAL(receivedNewLogLines(QString))); if (!_subscribed && numReceivers > 0) { enableToEntityServerScriptLog(DependencyManager::get()->getThisNodeCanRez()); @@ -58,8 +57,6 @@ void EntityScriptServerLogClient::enableToEntityServerScriptLog(bool enable) { } } _subscribed = enable; - } else { - qWarning() << "Entity Script Server not found"; } } diff --git a/scripts/developer/debugging/essDebugWindow.js b/scripts/developer/debugging/essDebugWindow.js index fbce09f93d..ef52694184 100644 --- a/scripts/developer/debugging/essDebugWindow.js +++ b/scripts/developer/debugging/essDebugWindow.js @@ -13,7 +13,7 @@ // Set up the qml ui var qml = Script.resolvePath('debugWindow.qml'); var window = new OverlayWindow({ - title: 'Debug Window', + title: 'Entity Script Server Log Window', source: qml, width: 400, height: 900, });