diff --git a/libraries/audio/src/AudioInjector.cpp b/libraries/audio/src/AudioInjector.cpp index 3255f8c1eb..23e37d911e 100644 --- a/libraries/audio/src/AudioInjector.cpp +++ b/libraries/audio/src/AudioInjector.cpp @@ -208,7 +208,7 @@ qint64 writeStringToStream(const QString& string, QDataStream& stream) { int64_t AudioInjector::injectNextFrame() { if (stateHas(AudioInjectorState::NetworkInjectionFinished)) { - qDebug() << "AudioInjector::injectNextFrame called but AudioInjector has finished and was not restarted. Returning."; + qCDebug(audio) << "AudioInjector::injectNextFrame called but AudioInjector has finished and was not restarted. Returning."; return NEXT_FRAME_DELTA_ERROR_OR_FINISHED; } @@ -231,7 +231,7 @@ int64_t AudioInjector::injectNextFrame() { auto numSamples = static_cast(_audioData.size() / sampleSize); auto targetSize = numSamples * sampleSize; if (targetSize != _audioData.size()) { - qDebug() << "Resizing audio that doesn't end at multiple of sample size, resizing from " + qCDebug(audio) << "Resizing audio that doesn't end at multiple of sample size, resizing from " << _audioData.size() << " to " << targetSize; _audioData.resize(targetSize); } @@ -297,7 +297,7 @@ int64_t AudioInjector::injectNextFrame() { } else { // no samples to inject, return immediately - qDebug() << "AudioInjector::injectNextFrame() called with no samples to inject. Returning."; + qCDebug(audio) << "AudioInjector::injectNextFrame() called with no samples to inject. Returning."; return NEXT_FRAME_DELTA_ERROR_OR_FINISHED; } } @@ -388,7 +388,7 @@ int64_t AudioInjector::injectNextFrame() { if (currentFrameBasedOnElapsedTime - _nextFrame > MAX_ALLOWED_FRAMES_TO_FALL_BEHIND) { // If we are falling behind by more frames than our threshold, let's skip the frames ahead - qDebug() << this << "injectNextFrame() skipping ahead, fell behind by " << (currentFrameBasedOnElapsedTime - _nextFrame) << " frames"; + qCDebug(audio) << this << "injectNextFrame() skipping ahead, fell behind by " << (currentFrameBasedOnElapsedTime - _nextFrame) << " frames"; _nextFrame = currentFrameBasedOnElapsedTime; _currentSendOffset = _nextFrame * AudioConstants::NETWORK_FRAME_BYTES_PER_CHANNEL * (_options.stereo ? 2 : 1) % _audioData.size(); } diff --git a/libraries/audio/src/AudioInjectorManager.cpp b/libraries/audio/src/AudioInjectorManager.cpp index b8560d1267..c66e209ea9 100644 --- a/libraries/audio/src/AudioInjectorManager.cpp +++ b/libraries/audio/src/AudioInjectorManager.cpp @@ -17,6 +17,7 @@ #include "AudioConstants.h" #include "AudioInjector.h" +#include "AudioLogging.h" AudioInjectorManager::~AudioInjectorManager() { _shouldStop = true; @@ -131,7 +132,7 @@ static const int MAX_INJECTORS_PER_THREAD = 40; // calculated based on AudioInje bool AudioInjectorManager::wouldExceedLimits() { // Should be called inside of a lock. if (_injectors.size() >= MAX_INJECTORS_PER_THREAD) { - qDebug() << "AudioInjectorManager::threadInjector could not thread AudioInjector - at max of" + qCDebug(audio) << "AudioInjectorManager::threadInjector could not thread AudioInjector - at max of" << MAX_INJECTORS_PER_THREAD << "current audio injectors."; return true; } @@ -140,7 +141,7 @@ bool AudioInjectorManager::wouldExceedLimits() { // Should be called inside of a bool AudioInjectorManager::threadInjector(AudioInjector* injector) { if (_shouldStop) { - qDebug() << "AudioInjectorManager::threadInjector asked to thread injector but is shutting down."; + qCDebug(audio) << "AudioInjectorManager::threadInjector asked to thread injector but is shutting down."; return false; } @@ -169,7 +170,7 @@ bool AudioInjectorManager::threadInjector(AudioInjector* injector) { bool AudioInjectorManager::restartFinishedInjector(AudioInjector* injector) { if (_shouldStop) { - qDebug() << "AudioInjectorManager::threadInjector asked to thread injector but is shutting down."; + qCDebug(audio) << "AudioInjectorManager::threadInjector asked to thread injector but is shutting down."; return false; } diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index ba60088117..36a6079546 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -153,7 +153,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) { auto afterProperties = message.readWithoutCopy(message.getBytesLeftToRead()); parseAudioData(message.getType(), afterProperties); } else { - qDebug() << "Codec mismatch: expected" << _selectedCodecName << "got" << codecInPacket << "writing silence"; + qDebug(audio) << "Codec mismatch: expected" << _selectedCodecName << "got" << codecInPacket << "writing silence"; writeDroppableSilentFrames(networkFrames); // inform others of the mismatch auto sendingNode = DependencyManager::get()->nodeWithUUID(message.getSourceID()); diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index f81a1169af..e2595bd55c 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -147,14 +147,14 @@ void AvatarData::nextAttitude(glm::vec3 position, glm::quat orientation) { bool success; Transform trans = getTransform(success); if (!success) { - qDebug() << "Warning -- AvatarData::nextAttitude failed"; + qCWarning(avatars) << "Warning -- AvatarData::nextAttitude failed"; return; } trans.setTranslation(position); trans.setRotation(orientation); SpatiallyNestable::setTransform(trans, success); if (!success) { - qDebug() << "Warning -- AvatarData::nextAttitude failed"; + qCWarning(avatars) << "Warning -- AvatarData::nextAttitude failed"; } updateAttitude(); } @@ -390,7 +390,7 @@ QByteArray AvatarData::toByteArray(bool cullSmallChanges, bool sendAll) { #ifdef WANT_DEBUG if (sendAll) { - qDebug() << "AvatarData::toByteArray" << cullSmallChanges << sendAll + qCDebug(avatars) << "AvatarData::toByteArray" << cullSmallChanges << sendAll << "rotations:" << rotationSentCount << "translations:" << translationSentCount << "largest:" << maxTranslationDimension << "size:" @@ -678,7 +678,7 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) { #ifdef WANT_DEBUG if (numValidJointRotations > 15) { - qDebug() << "RECEIVING -- rotations:" << numValidJointRotations + qCDebug(avatars) << "RECEIVING -- rotations:" << numValidJointRotations << "translations:" << numValidJointTranslations << "size:" << (int)(sourceBuffer - startPosition); } @@ -1448,7 +1448,7 @@ QJsonObject AvatarData::toJson() const { bool success; Transform avatarTransform = getTransform(success); if (!success) { - qDebug() << "Warning -- AvatarData::toJson couldn't get avatar transform"; + qCWarning(avatars) << "Warning -- AvatarData::toJson couldn't get avatar transform"; } avatarTransform.setScale(getDomainLimitedScale()); if (recordingBasis) { @@ -1593,7 +1593,7 @@ QByteArray AvatarData::toFrame(const AvatarData& avatar) { { QJsonObject obj = root; obj.remove(JSON_AVATAR_JOINT_ARRAY); - qDebug().noquote() << QJsonDocument(obj).toJson(QJsonDocument::JsonFormat::Indented); + qCDebug(avatars).noquote() << QJsonDocument(obj).toJson(QJsonDocument::JsonFormat::Indented); } #endif return QJsonDocument(root).toBinaryData(); @@ -1606,7 +1606,7 @@ void AvatarData::fromFrame(const QByteArray& frameData, AvatarData& result) { { QJsonObject obj = doc.object(); obj.remove(JSON_AVATAR_JOINT_ARRAY); - qDebug().noquote() << QJsonDocument(obj).toJson(QJsonDocument::JsonFormat::Indented); + qCDebug(avatars).noquote() << QJsonDocument(obj).toJson(QJsonDocument::JsonFormat::Indented); } #endif result.fromJson(doc.object()); diff --git a/libraries/avatars/src/AvatarHashMap.cpp b/libraries/avatars/src/AvatarHashMap.cpp index ea9a4f42f8..571d665feb 100644 --- a/libraries/avatars/src/AvatarHashMap.cpp +++ b/libraries/avatars/src/AvatarHashMap.cpp @@ -160,7 +160,7 @@ void AvatarHashMap::removeAvatar(const QUuid& sessionUUID, KillAvatarReason remo } void AvatarHashMap::handleRemovedAvatar(const AvatarSharedPointer& removedAvatar, KillAvatarReason removalReason) { - qDebug() << "Removed avatar with UUID" << uuidStringWithoutCurlyBraces(removedAvatar->getSessionUUID()) + qCDebug(avatars) << "Removed avatar with UUID" << uuidStringWithoutCurlyBraces(removedAvatar->getSessionUUID()) << "from AvatarHashMap"; emit avatarRemovedEvent(removedAvatar->getSessionUUID()); } diff --git a/libraries/display-plugins/src/display-plugins/CompositorHelper.cpp b/libraries/display-plugins/src/display-plugins/CompositorHelper.cpp index 56be8e1cf9..d8e0c59da7 100644 --- a/libraries/display-plugins/src/display-plugins/CompositorHelper.cpp +++ b/libraries/display-plugins/src/display-plugins/CompositorHelper.cpp @@ -152,7 +152,6 @@ CompositorHelper::CompositorHelper() : // auto cursor = Cursor::Manager::instance().getCursor(); // cursor->setIcon(Cursor::Icon::DEFAULT); // if (!_tooltipId.isEmpty()) { - // qDebug() << "Closing tooltip " << _tooltipId; // Tooltip::closeTip(_tooltipId); // _tooltipId.clear(); // } diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp index 68c05062fd..c4846f6af8 100644 --- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp @@ -96,7 +96,7 @@ public: Lock lock(_mutex); _shutdown = true; _condition.wait(lock, [&] { return !_shutdown; }); - qDebug() << "Present thread shutdown"; + qCDebug(displayPlugins) << "Present thread shutdown"; } } diff --git a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp index e0c3dab1ed..a8b8ba3618 100644 --- a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.cpp @@ -741,7 +741,6 @@ void HmdDisplayPlugin::compositeExtra() { } HmdDisplayPlugin::~HmdDisplayPlugin() { - qDebug() << "Destroying HmdDisplayPlugin"; } float HmdDisplayPlugin::stutterRate() const { diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 0008d0fbcc..411433302d 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -286,7 +286,7 @@ bool RenderableModelEntityItem::getAnimationFrame() { resizeJointArrays(); if (_jointMapping.size() != _model->getJointStateCount()) { - qDebug() << "RenderableModelEntityItem::getAnimationFrame -- joint count mismatch" + qCDebug(entities) << "RenderableModelEntityItem::getAnimationFrame -- joint count mismatch" << _jointMapping.size() << _model->getJointStateCount(); assert(false); return false; diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp index e0c068ea6b..7646f0a454 100644 --- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp @@ -890,7 +890,7 @@ void RenderablePolyVoxEntityItem::decompressVolumeData() { if (voxelXSize == 0 || voxelXSize > PolyVoxEntityItem::MAX_VOXEL_DIMENSION || voxelYSize == 0 || voxelYSize > PolyVoxEntityItem::MAX_VOXEL_DIMENSION || voxelZSize == 0 || voxelZSize > PolyVoxEntityItem::MAX_VOXEL_DIMENSION) { - qDebug() << "voxelSize is not reasonable, skipping decompressions." + qCDebug(entities) << "voxelSize is not reasonable, skipping decompressions." << voxelXSize << voxelYSize << voxelZSize << getName() << getID(); entity->setVoxelDataDirty(false); return; @@ -903,7 +903,7 @@ void RenderablePolyVoxEntityItem::decompressVolumeData() { QByteArray uncompressedData = qUncompress(compressedData); if (uncompressedData.size() != rawSize) { - qDebug() << "PolyVox decompress -- size is (" << voxelXSize << voxelYSize << voxelZSize << ")" + qCDebug(entities) << "PolyVox decompress -- size is (" << voxelXSize << voxelYSize << voxelZSize << ")" << "so expected uncompressed length of" << rawSize << "but length is" << uncompressedData.size() << getName() << getID(); entity->setVoxelDataDirty(false); @@ -973,7 +973,7 @@ void RenderablePolyVoxEntityItem::compressVolumeDataAndSendEditPacket() { if (newVoxelData.size() > 1150) { // HACK -- until we have a way to allow for properties larger than MTU, don't update. // revert the active voxel-space to the last version that fit. - qDebug() << "compressed voxel data is too large" << entity->getName() << entity->getID(); + qCDebug(entities) << "compressed voxel data is too large" << entity->getName() << entity->getID(); return; } diff --git a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp index 5290f3df19..7fad3b44d6 100644 --- a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp @@ -46,7 +46,7 @@ EntityItemPointer RenderableWebEntityItem::factory(const EntityItemID& entityID, RenderableWebEntityItem::RenderableWebEntityItem(const EntityItemID& entityItemID) : WebEntityItem(entityItemID) { - qDebug() << "Created web entity " << getID(); + qCDebug(entities) << "Created web entity " << getID(); _touchDevice.setCapabilities(QTouchDevice::Position); _touchDevice.setType(QTouchDevice::TouchScreen); @@ -57,7 +57,7 @@ RenderableWebEntityItem::RenderableWebEntityItem(const EntityItemID& entityItemI RenderableWebEntityItem::~RenderableWebEntityItem() { destroyWebSurface(); - qDebug() << "Destroyed web entity " << getID(); + qCDebug(entities) << "Destroyed web entity " << getID(); auto geometryCache = DependencyManager::get(); if (geometryCache) { geometryCache->releaseID(_geometryId); @@ -90,7 +90,7 @@ bool RenderableWebEntityItem::buildWebSurface(QSharedPointer } ++_currentWebCount; - qDebug() << "Building web surface: " << getID() << ", #" << _currentWebCount << ", url = " << _sourceUrl; + qCDebug(entities) << "Building web surface: " << getID() << ", #" << _currentWebCount << ", url = " << _sourceUrl; QSurface * currentSurface = currentContext->surface(); @@ -247,7 +247,7 @@ void RenderableWebEntityItem::render(RenderArgs* args) { void RenderableWebEntityItem::setSourceUrl(const QString& value) { if (_sourceUrl != value) { - qDebug() << "Setting web entity source URL to " << value; + qCDebug(entities) << "Setting web entity source URL to " << value; _sourceUrl = value; if (_webSurface) { AbstractViewStateInterface::instance()->postLambdaEvent([this] { @@ -358,7 +358,7 @@ void RenderableWebEntityItem::destroyWebSurface() { _hoverLeaveConnection = QMetaObject::Connection(); _webSurface.reset(); - qDebug() << "Delete web surface: " << getID() << ", #" << _currentWebCount << ", url = " << _sourceUrl; + qCDebug(entities) << "Delete web surface: " << getID() << ", #" << _currentWebCount << ", url = " << _sourceUrl; } } diff --git a/libraries/entities/src/AnimationPropertyGroup.cpp b/libraries/entities/src/AnimationPropertyGroup.cpp index 04fbd40d13..f6d08ad8b9 100644 --- a/libraries/entities/src/AnimationPropertyGroup.cpp +++ b/libraries/entities/src/AnimationPropertyGroup.cpp @@ -167,10 +167,10 @@ void AnimationPropertyGroup::setFromOldAnimationSettings(const QString& value) { void AnimationPropertyGroup::debugDump() const { - qDebug() << " AnimationPropertyGroup: ---------------------------------------------"; - qDebug() << " url:" << getURL() << " has changed:" << urlChanged(); - qDebug() << " fps:" << getFPS() << " has changed:" << fpsChanged(); - qDebug() << "currentFrame:" << getCurrentFrame() << " has changed:" << currentFrameChanged(); + qCDebug(entities) << " AnimationPropertyGroup: ---------------------------------------------"; + qCDebug(entities) << " url:" << getURL() << " has changed:" << urlChanged(); + qCDebug(entities) << " fps:" << getFPS() << " has changed:" << fpsChanged(); + qCDebug(entities) << "currentFrame:" << getCurrentFrame() << " has changed:" << currentFrameChanged(); } void AnimationPropertyGroup::listChangedProperties(QList& out) { diff --git a/libraries/entities/src/EntityActionInterface.cpp b/libraries/entities/src/EntityActionInterface.cpp index 2ce4ce5555..23e6fc0202 100644 --- a/libraries/entities/src/EntityActionInterface.cpp +++ b/libraries/entities/src/EntityActionInterface.cpp @@ -104,7 +104,7 @@ EntityActionType EntityActionInterface::actionTypeFromString(QString actionTypeS return ACTION_TYPE_TRAVEL_ORIENTED; } - qDebug() << "Warning -- EntityActionInterface::actionTypeFromString got unknown action-type name" << actionTypeString; + qCDebug(entities) << "Warning -- EntityActionInterface::actionTypeFromString got unknown action-type name" << actionTypeString; return ACTION_TYPE_NONE; } @@ -129,7 +129,7 @@ glm::vec3 EntityActionInterface::extractVec3Argument(QString objectName, QVarian QString argumentName, bool& ok, bool required) { if (!arguments.contains(argumentName)) { if (required) { - qDebug() << objectName << "requires argument:" << argumentName; + qCDebug(entities) << objectName << "requires argument:" << argumentName; } ok = false; return glm::vec3(0.0f); @@ -137,14 +137,14 @@ glm::vec3 EntityActionInterface::extractVec3Argument(QString objectName, QVarian QVariant resultV = arguments[argumentName]; if (resultV.type() != (QVariant::Type) QMetaType::QVariantMap) { - qDebug() << objectName << "argument" << argumentName << "must be a map"; + qCDebug(entities) << objectName << "argument" << argumentName << "must be a map"; ok = false; return glm::vec3(0.0f); } QVariantMap resultVM = resultV.toMap(); if (!resultVM.contains("x") || !resultVM.contains("y") || !resultVM.contains("z")) { - qDebug() << objectName << "argument" << argumentName << "must be a map with keys: x, y, z"; + qCDebug(entities) << objectName << "argument" << argumentName << "must be a map with keys: x, y, z"; ok = false; return glm::vec3(0.0f); } @@ -160,7 +160,7 @@ glm::vec3 EntityActionInterface::extractVec3Argument(QString objectName, QVarian float y = yV.toFloat(&yOk); float z = zV.toFloat(&zOk); if (!xOk || !yOk || !zOk) { - qDebug() << objectName << "argument" << argumentName << "must be a map with keys: x, y, and z of type float."; + qCDebug(entities) << objectName << "argument" << argumentName << "must be a map with keys: x, y, and z of type float."; ok = false; return glm::vec3(0.0f); } @@ -178,7 +178,7 @@ glm::quat EntityActionInterface::extractQuatArgument(QString objectName, QVarian QString argumentName, bool& ok, bool required) { if (!arguments.contains(argumentName)) { if (required) { - qDebug() << objectName << "requires argument:" << argumentName; + qCDebug(entities) << objectName << "requires argument:" << argumentName; } ok = false; return glm::quat(); @@ -186,14 +186,14 @@ glm::quat EntityActionInterface::extractQuatArgument(QString objectName, QVarian QVariant resultV = arguments[argumentName]; if (resultV.type() != (QVariant::Type) QMetaType::QVariantMap) { - qDebug() << objectName << "argument" << argumentName << "must be a map, not" << resultV.typeName(); + qCDebug(entities) << objectName << "argument" << argumentName << "must be a map, not" << resultV.typeName(); ok = false; return glm::quat(); } QVariantMap resultVM = resultV.toMap(); if (!resultVM.contains("x") || !resultVM.contains("y") || !resultVM.contains("z") || !resultVM.contains("w")) { - qDebug() << objectName << "argument" << argumentName << "must be a map with keys: x, y, z, and w"; + qCDebug(entities) << objectName << "argument" << argumentName << "must be a map with keys: x, y, z, and w"; ok = false; return glm::quat(); } @@ -212,7 +212,7 @@ glm::quat EntityActionInterface::extractQuatArgument(QString objectName, QVarian float z = zV.toFloat(&zOk); float w = wV.toFloat(&wOk); if (!xOk || !yOk || !zOk || !wOk) { - qDebug() << objectName << "argument" << argumentName + qCDebug(entities) << objectName << "argument" << argumentName << "must be a map with keys: x, y, z, and w of type float."; ok = false; return glm::quat(); @@ -231,7 +231,7 @@ float EntityActionInterface::extractFloatArgument(QString objectName, QVariantMa QString argumentName, bool& ok, bool required) { if (!arguments.contains(argumentName)) { if (required) { - qDebug() << objectName << "requires argument:" << argumentName; + qCDebug(entities) << objectName << "requires argument:" << argumentName; } ok = false; return 0.0f; @@ -253,7 +253,7 @@ int EntityActionInterface::extractIntegerArgument(QString objectName, QVariantMa QString argumentName, bool& ok, bool required) { if (!arguments.contains(argumentName)) { if (required) { - qDebug() << objectName << "requires argument:" << argumentName; + qCDebug(entities) << objectName << "requires argument:" << argumentName; } ok = false; return 0.0f; @@ -275,7 +275,7 @@ QString EntityActionInterface::extractStringArgument(QString objectName, QVarian QString argumentName, bool& ok, bool required) { if (!arguments.contains(argumentName)) { if (required) { - qDebug() << objectName << "requires argument:" << argumentName; + qCDebug(entities) << objectName << "requires argument:" << argumentName; } ok = false; return ""; @@ -287,7 +287,7 @@ bool EntityActionInterface::extractBooleanArgument(QString objectName, QVariantM QString argumentName, bool& ok, bool required) { if (!arguments.contains(argumentName)) { if (required) { - qDebug() << objectName << "requires argument:" << argumentName; + qCDebug(entities) << objectName << "requires argument:" << argumentName; } ok = false; return false; diff --git a/libraries/entities/src/EntityEditPacketSender.cpp b/libraries/entities/src/EntityEditPacketSender.cpp index 4478e37003..e05db07d0d 100644 --- a/libraries/entities/src/EntityEditPacketSender.cpp +++ b/libraries/entities/src/EntityEditPacketSender.cpp @@ -52,12 +52,12 @@ void EntityEditPacketSender::queueEditAvatarEntityMessage(PacketType type, assert(_myAvatar); if (!entityTree) { - qDebug() << "EntityEditPacketSender::queueEditEntityMessage null entityTree."; + qCDebug(entities) << "EntityEditPacketSender::queueEditEntityMessage null entityTree."; return; } EntityItemPointer entity = entityTree->findEntityByEntityItemID(entityItemID); if (!entity) { - qDebug() << "EntityEditPacketSender::queueEditEntityMessage can't find entity."; + qCDebug(entities) << "EntityEditPacketSender::queueEditEntityMessage can't find entity."; return; } diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 43947708ba..326ad96b66 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -183,7 +183,7 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties } if (propertiesWithSimID.getParentID() == AVATAR_SELF_ID) { - qDebug() << "ERROR: Cannot set entity parent ID to the local-only MyAvatar ID"; + qCDebug(entities) << "ERROR: Cannot set entity parent ID to the local-only MyAvatar ID"; propertiesWithSimID.setParentID(QUuid()); } @@ -364,7 +364,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& if (!scriptSideProperties.parentIDChanged()) { properties.setParentID(entity->getParentID()); } else if (scriptSideProperties.getParentID() == AVATAR_SELF_ID) { - qDebug() << "ERROR: Cannot set entity parent ID to the local-only MyAvatar ID"; + qCDebug(entities) << "ERROR: Cannot set entity parent ID to the local-only MyAvatar ID"; properties.setParentID(QUuid()); } if (!scriptSideProperties.parentJointIndexChanged()) { @@ -925,12 +925,12 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID, EntitySimulationPointer simulation = _entityTree->getSimulation(); entity = _entityTree->findEntityByEntityItemID(entityID); if (!entity) { - qDebug() << "actionWorker -- unknown entity" << entityID; + qCDebug(entities) << "actionWorker -- unknown entity" << entityID; return; } if (!simulation) { - qDebug() << "actionWorker -- no simulation" << entityID; + qCDebug(entities) << "actionWorker -- no simulation" << entityID; return; } @@ -1045,7 +1045,7 @@ EntityItemPointer EntityScriptingInterface::checkForTreeEntityAndTypeMatch(const EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID); if (!entity) { - qDebug() << "EntityScriptingInterface::checkForTreeEntityAndTypeMatch - no entity with ID" << entityID; + qCDebug(entities) << "EntityScriptingInterface::checkForTreeEntityAndTypeMatch - no entity with ID" << entityID; return entity; } @@ -1305,7 +1305,7 @@ QVector EntityScriptingInterface::getChildrenIDs(const QUuid& parentID) { EntityItemPointer entity = _entityTree->findEntityByEntityItemID(parentID); if (!entity) { - qDebug() << "EntityScriptingInterface::getChildrenIDs - no entity with ID" << parentID; + qCDebug(entities) << "EntityScriptingInterface::getChildrenIDs - no entity with ID" << parentID; return result; } diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 7f4cfa78d0..4796dda671 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -343,7 +343,7 @@ EntityItemPointer EntityTree::addEntity(const EntityItemID& entityID, const Enti auto nodeList = DependencyManager::get(); if (!nodeList) { - qDebug() << "EntityTree::addEntity -- can't get NodeList"; + qCDebug(entities) << "EntityTree::addEntity -- can't get NodeList"; return nullptr; } @@ -1243,7 +1243,7 @@ bool EntityTree::hasEntitiesDeletedSince(quint64 sinceTime) { if (hasSomethingNewer) { int elapsed = usecTimestampNow() - considerEntitiesSince; int difference = considerEntitiesSince - sinceTime; - qDebug() << "EntityTree::hasEntitiesDeletedSince() sinceTime:" << sinceTime + qCDebug(entities) << "EntityTree::hasEntitiesDeletedSince() sinceTime:" << sinceTime << "considerEntitiesSince:" << considerEntitiesSince << "elapsed:" << elapsed << "difference:" << difference; } #endif @@ -1276,7 +1276,7 @@ void EntityTree::forgetEntitiesDeletedBefore(quint64 sinceTime) { // TODO: consider consolidating processEraseMessageDetails() and processEraseMessage() int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode) { #ifdef EXTRA_ERASE_DEBUGGING - qDebug() << "EntityTree::processEraseMessage()"; + qCDebug(entities) << "EntityTree::processEraseMessage()"; #endif withWriteLock([&] { message.seek(sizeof(OCTREE_PACKET_FLAGS) + sizeof(OCTREE_PACKET_SEQUENCE) + sizeof(OCTREE_PACKET_SENT_TIME)); @@ -1296,7 +1296,7 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo QUuid entityID = QUuid::fromRfc4122(message.readWithoutCopy(NUM_BYTES_RFC4122_UUID)); #ifdef EXTRA_ERASE_DEBUGGING - qDebug() << " ---- EntityTree::processEraseMessage() contained ID:" << entityID; + qCDebug(entities) << " ---- EntityTree::processEraseMessage() contained ID:" << entityID; #endif EntityItemID entityItemID(entityID); @@ -1318,7 +1318,7 @@ int EntityTree::processEraseMessage(ReceivedMessage& message, const SharedNodePo // TODO: consider consolidating processEraseMessageDetails() and processEraseMessage() int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, const SharedNodePointer& sourceNode) { #ifdef EXTRA_ERASE_DEBUGGING - qDebug() << "EntityTree::processEraseMessageDetails()"; + qCDebug(entities) << "EntityTree::processEraseMessageDetails()"; #endif const unsigned char* packetData = (const unsigned char*)dataByteArray.constData(); const unsigned char* dataAt = packetData; @@ -1347,7 +1347,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons processedBytes += encodedID.size(); #ifdef EXTRA_ERASE_DEBUGGING - qDebug() << " ---- EntityTree::processEraseMessageDetails() contains id:" << entityID; + qCDebug(entities) << " ---- EntityTree::processEraseMessageDetails() contains id:" << entityID; #endif EntityItemID entityItemID(entityID); diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index 4660d8780e..e374c6d289 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -329,7 +329,7 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData includeThisEntity = false; // too small, don't include it #ifdef WANT_LOD_DEBUGGING - qDebug() << "skipping entity - TOO SMALL - \n" + qCDebug(entities) << "skipping entity - TOO SMALL - \n" << "......id:" << entity->getID() << "\n" << "....name:" << entity->getName() << "\n" << "..bounds:" << entityBounds << "\n" @@ -341,7 +341,7 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData if (includeThisEntity) { #ifdef WANT_LOD_DEBUGGING - qDebug() << "including entity - \n" + qCDebug(entities) << "including entity - \n" << "......id:" << entity->getID() << "\n" << "....name:" << entity->getName() << "\n" << "....cell:" << getAACube(); @@ -472,7 +472,7 @@ bool EntityTreeElement::bestFitEntityBounds(EntityItemPointer entity) const { bool success; auto queryCube = entity->getQueryAACube(success); if (!success) { - qDebug() << "EntityTreeElement::bestFitEntityBounds couldn't get queryCube for" << entity->getName() << entity->getID(); + qCDebug(entities) << "EntityTreeElement::bestFitEntityBounds couldn't get queryCube for" << entity->getName() << entity->getID(); return false; } return bestFitBounds(queryCube); @@ -973,7 +973,7 @@ int EntityTreeElement::readElementDataFromBuffer(const unsigned char* data, int } } else { #ifdef WANT_DEBUG - qDebug() << "Received packet for previously deleted entity [" << + qCDebug(entities) << "Received packet for previously deleted entity [" << entityItem->getID() << "] ignoring. (inside " << __FUNCTION__ << ")"; #endif } diff --git a/libraries/entities/src/EntityTypes.h b/libraries/entities/src/EntityTypes.h index 016cda6cf7..fd09d4e67b 100644 --- a/libraries/entities/src/EntityTypes.h +++ b/libraries/entities/src/EntityTypes.h @@ -19,6 +19,8 @@ #include // for RenderArgs +#include "EntitiesLogging.h" + class EntityItem; using EntityItemPointer = std::shared_ptr; using EntityItemWeakPointer = std::weak_ptr; @@ -77,7 +79,7 @@ private: struct EntityRegistrationChecker { EntityRegistrationChecker(bool result, const char* debugMessage) { if (!result) { - qDebug() << debugMessage; + qCDebug(entities) << debugMessage; } } }; diff --git a/libraries/entities/src/KeyLightPropertyGroup.cpp b/libraries/entities/src/KeyLightPropertyGroup.cpp index 34ea7cd366..1011094266 100644 --- a/libraries/entities/src/KeyLightPropertyGroup.cpp +++ b/libraries/entities/src/KeyLightPropertyGroup.cpp @@ -60,12 +60,12 @@ void KeyLightPropertyGroup::merge(const KeyLightPropertyGroup& other) { void KeyLightPropertyGroup::debugDump() const { - qDebug() << " KeyLightPropertyGroup: ---------------------------------------------"; - qDebug() << " color:" << getColor(); // << "," << getColor()[1] << "," << getColor()[2]; - qDebug() << " intensity:" << getIntensity(); - qDebug() << " direction:" << getDirection(); - qDebug() << " ambientIntensity:" << getAmbientIntensity(); - qDebug() << " ambientURL:" << getAmbientURL(); + qCDebug(entities) << " KeyLightPropertyGroup: ---------------------------------------------"; + qCDebug(entities) << " color:" << getColor(); // << "," << getColor()[1] << "," << getColor()[2]; + qCDebug(entities) << " intensity:" << getIntensity(); + qCDebug(entities) << " direction:" << getDirection(); + qCDebug(entities) << " ambientIntensity:" << getAmbientIntensity(); + qCDebug(entities) << " ambientURL:" << getAmbientURL(); } void KeyLightPropertyGroup::listChangedProperties(QList& out) { diff --git a/libraries/entities/src/LineEntityItem.cpp b/libraries/entities/src/LineEntityItem.cpp index 01d713ad17..315de4938e 100644 --- a/libraries/entities/src/LineEntityItem.cpp +++ b/libraries/entities/src/LineEntityItem.cpp @@ -80,12 +80,12 @@ bool LineEntityItem::setProperties(const EntityItemProperties& properties) { bool LineEntityItem::appendPoint(const glm::vec3& point) { if (_points.size() > MAX_POINTS_PER_LINE - 1) { - qDebug() << "MAX POINTS REACHED!"; + qCDebug(entities) << "MAX POINTS REACHED!"; return false; } glm::vec3 halfBox = getDimensions() * 0.5f; if ( (point.x < - halfBox.x || point.x > halfBox.x) || (point.y < -halfBox.y || point.y > halfBox.y) || (point.z < - halfBox.z || point.z > halfBox.z) ) { - qDebug() << "Point is outside entity's bounding box"; + qCDebug(entities) << "Point is outside entity's bounding box"; return false; } _points << point; @@ -101,7 +101,7 @@ bool LineEntityItem::setLinePoints(const QVector& points) { for (int i = 0; i < points.size(); i++) { glm::vec3 point = points.at(i); if ( (point.x < - halfBox.x || point.x > halfBox.x) || (point.y < -halfBox.y || point.y > halfBox.y) || (point.z < - halfBox.z || point.z > halfBox.z) ) { - qDebug() << "Point is outside entity's bounding box"; + qCDebug(entities) << "Point is outside entity's bounding box"; return false; } } diff --git a/libraries/entities/src/PolyLineEntityItem.cpp b/libraries/entities/src/PolyLineEntityItem.cpp index c9c5dd5df4..4cd59488c2 100644 --- a/libraries/entities/src/PolyLineEntityItem.cpp +++ b/libraries/entities/src/PolyLineEntityItem.cpp @@ -89,12 +89,12 @@ bool PolyLineEntityItem::setProperties(const EntityItemProperties& properties) { bool PolyLineEntityItem::appendPoint(const glm::vec3& point) { if (_points.size() > MAX_POINTS_PER_LINE - 1) { - qDebug() << "MAX POINTS REACHED!"; + qCDebug(entities) << "MAX POINTS REACHED!"; return false; } glm::vec3 halfBox = getDimensions() * 0.5f; if ((point.x < -halfBox.x || point.x > halfBox.x) || (point.y < -halfBox.y || point.y > halfBox.y) || (point.z < -halfBox.z || point.z > halfBox.z)) { - qDebug() << "Point is outside entity's bounding box"; + qCDebug(entities) << "Point is outside entity's bounding box"; return false; } _points << point; @@ -142,7 +142,7 @@ bool PolyLineEntityItem::setLinePoints(const QVector& points) { if ((point.x < -halfBox.x || point.x > halfBox.x) || (point.y < -halfBox.y || point.y > halfBox.y) || (point.z < -halfBox.z || point.z > halfBox.z)) { - qDebug() << "Point is outside entity's bounding box"; + qCDebug(entities) << "Point is outside entity's bounding box"; return false; } } diff --git a/libraries/entities/src/PolyVoxEntityItem.cpp b/libraries/entities/src/PolyVoxEntityItem.cpp index 95d977c350..958b3ff88c 100644 --- a/libraries/entities/src/PolyVoxEntityItem.cpp +++ b/libraries/entities/src/PolyVoxEntityItem.cpp @@ -71,29 +71,29 @@ void PolyVoxEntityItem::setVoxelVolumeSize(glm::vec3 voxelVolumeSize) { _voxelVolumeSize = glm::vec3(roundf(voxelVolumeSize.x), roundf(voxelVolumeSize.y), roundf(voxelVolumeSize.z)); if (_voxelVolumeSize.x < 1) { - qDebug() << "PolyVoxEntityItem::setVoxelVolumeSize clamping x of" << _voxelVolumeSize.x << "to 1"; + qCDebug(entities) << "PolyVoxEntityItem::setVoxelVolumeSize clamping x of" << _voxelVolumeSize.x << "to 1"; _voxelVolumeSize.x = 1; } if (_voxelVolumeSize.x > MAX_VOXEL_DIMENSION) { - qDebug() << "PolyVoxEntityItem::setVoxelVolumeSize clamping x of" << _voxelVolumeSize.x << "to max"; + qCDebug(entities) << "PolyVoxEntityItem::setVoxelVolumeSize clamping x of" << _voxelVolumeSize.x << "to max"; _voxelVolumeSize.x = MAX_VOXEL_DIMENSION; } if (_voxelVolumeSize.y < 1) { - qDebug() << "PolyVoxEntityItem::setVoxelVolumeSize clamping y of" << _voxelVolumeSize.y << "to 1"; + qCDebug(entities) << "PolyVoxEntityItem::setVoxelVolumeSize clamping y of" << _voxelVolumeSize.y << "to 1"; _voxelVolumeSize.y = 1; } if (_voxelVolumeSize.y > MAX_VOXEL_DIMENSION) { - qDebug() << "PolyVoxEntityItem::setVoxelVolumeSize clamping y of" << _voxelVolumeSize.y << "to max"; + qCDebug(entities) << "PolyVoxEntityItem::setVoxelVolumeSize clamping y of" << _voxelVolumeSize.y << "to max"; _voxelVolumeSize.y = MAX_VOXEL_DIMENSION; } if (_voxelVolumeSize.z < 1) { - qDebug() << "PolyVoxEntityItem::setVoxelVolumeSize clamping z of" << _voxelVolumeSize.z << "to 1"; + qCDebug(entities) << "PolyVoxEntityItem::setVoxelVolumeSize clamping z of" << _voxelVolumeSize.z << "to 1"; _voxelVolumeSize.z = 1; } if (_voxelVolumeSize.z > MAX_VOXEL_DIMENSION) { - qDebug() << "PolyVoxEntityItem::setVoxelVolumeSize clamping z of" << _voxelVolumeSize.z << "to max"; + qCDebug(entities) << "PolyVoxEntityItem::setVoxelVolumeSize clamping z of" << _voxelVolumeSize.z << "to max"; _voxelVolumeSize.z = MAX_VOXEL_DIMENSION; } }); diff --git a/libraries/entities/src/SkyboxPropertyGroup.cpp b/libraries/entities/src/SkyboxPropertyGroup.cpp index 51a99b0210..f8baf57856 100644 --- a/libraries/entities/src/SkyboxPropertyGroup.cpp +++ b/libraries/entities/src/SkyboxPropertyGroup.cpp @@ -34,9 +34,9 @@ void SkyboxPropertyGroup::merge(const SkyboxPropertyGroup& other) { void SkyboxPropertyGroup::debugDump() const { - qDebug() << " SkyboxPropertyGroup: ---------------------------------------------"; - qDebug() << " Color:" << getColor() << " has changed:" << colorChanged(); - qDebug() << " URL:" << getURL() << " has changed:" << urlChanged(); + qCDebug(entities) << " SkyboxPropertyGroup: ---------------------------------------------"; + qCDebug(entities) << " Color:" << getColor() << " has changed:" << colorChanged(); + qCDebug(entities) << " URL:" << getURL() << " has changed:" << urlChanged(); } void SkyboxPropertyGroup::listChangedProperties(QList& out) { diff --git a/libraries/entities/src/StagePropertyGroup.cpp b/libraries/entities/src/StagePropertyGroup.cpp index 9bd8f89307..cd486c96ac 100644 --- a/libraries/entities/src/StagePropertyGroup.cpp +++ b/libraries/entities/src/StagePropertyGroup.cpp @@ -67,14 +67,14 @@ void StagePropertyGroup::merge(const StagePropertyGroup& other) { void StagePropertyGroup::debugDump() const { - qDebug() << " StagePropertyGroup: ---------------------------------------------"; - qDebug() << " _sunModelEnabled:" << _sunModelEnabled; - qDebug() << " _latitude:" << _latitude; - qDebug() << " _longitude:" << _longitude; - qDebug() << " _altitude:" << _altitude; - qDebug() << " _day:" << _day; - qDebug() << " _hour:" << _hour; - qDebug() << " _automaticHourDay:" << _automaticHourDay; + qCDebug(entities) << " StagePropertyGroup: ---------------------------------------------"; + qCDebug(entities) << " _sunModelEnabled:" << _sunModelEnabled; + qCDebug(entities) << " _latitude:" << _latitude; + qCDebug(entities) << " _longitude:" << _longitude; + qCDebug(entities) << " _altitude:" << _altitude; + qCDebug(entities) << " _day:" << _day; + qCDebug(entities) << " _hour:" << _hour; + qCDebug(entities) << " _automaticHourDay:" << _automaticHourDay; } void StagePropertyGroup::listChangedProperties(QList& out) { diff --git a/libraries/fbx/src/FSTReader.cpp b/libraries/fbx/src/FSTReader.cpp index 1f7999bdaa..3f0a629c8c 100644 --- a/libraries/fbx/src/FSTReader.cpp +++ b/libraries/fbx/src/FSTReader.cpp @@ -194,7 +194,6 @@ QVariantHash FSTReader::downloadMapping(const QString& url) { networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT); QNetworkReply* reply = networkAccessManager.get(networkRequest); - qDebug() << "Downloading avatar file at " << url; QEventLoop loop; QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit); loop.exec(); diff --git a/libraries/gpu-gl/src/gpu/gl/GLBackendState.cpp b/libraries/gpu-gl/src/gpu/gl/GLBackendState.cpp index 1b40af6174..6f8c229184 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLBackendState.cpp +++ b/libraries/gpu-gl/src/gpu/gl/GLBackendState.cpp @@ -11,6 +11,8 @@ #include "GLBackend.h" #include "GLState.h" +#include + using namespace gpu; using namespace gpu::gl; @@ -172,7 +174,7 @@ void GLBackend::do_setStateDepthTest(State::DepthTest test) { glDepthFunc(COMPARISON_TO_GL[test.getFunction()]); } if (CHECK_GL_ERROR()) { - qDebug() << "DepthTest" << (test.isEnabled() ? "Enabled" : "Disabled") + qCDebug(gpulogging) << "DepthTest" << (test.isEnabled() ? "Enabled" : "Disabled") << "Mask=" << (test.getWriteMask() ? "Write" : "no Write") << "Func=" << test.getFunction() << "Raw=" << test.getRaw(); diff --git a/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.cpp b/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.cpp index 45403f4d4d..df9153d43e 100644 --- a/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.cpp +++ b/libraries/gpu-gl/src/gpu/gl/GLTextureTransfer.cpp @@ -10,6 +10,8 @@ #include #include +#include + #include "GLShared.h" #include "GLTexture.h" @@ -155,7 +157,7 @@ bool GLTextureTransferHelper::process() { auto lastReportInterval = now - lastReport; if (lastReportInterval > USECS_PER_SECOND * 4) { lastReport = now; - qDebug() << "Texture list " << _transferringTextures.size(); + qCDebug(gpulogging) << "Texture list " << _transferringTextures.size(); } size_t transferCount = 0; diff --git a/libraries/gpu/src/gpu/Buffer.h b/libraries/gpu/src/gpu/Buffer.h index 910b899d69..2507e8e0a6 100644 --- a/libraries/gpu/src/gpu/Buffer.h +++ b/libraries/gpu/src/gpu/Buffer.h @@ -13,6 +13,7 @@ #if _DEBUG #include +#include "GPULogging.h" #endif #include "Forward.h" @@ -318,13 +319,13 @@ public: template const T& get() const { #if _DEBUG if (!_buffer) { - qDebug() << "Accessing null gpu::buffer!"; + qCDebug(gpulogging) << "Accessing null gpu::buffer!"; } if (sizeof(T) > (_buffer->getSize() - _offset)) { - qDebug() << "Accessing buffer in non allocated memory, element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - _offset); + qCDebug(gpulogging) << "Accessing buffer in non allocated memory, element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - _offset); } if (sizeof(T) > _size) { - qDebug() << "Accessing buffer outside the BufferView range, element size = " << sizeof(T) << " when bufferView size = " << _size; + qCDebug(gpulogging) << "Accessing buffer outside the BufferView range, element size = " << sizeof(T) << " when bufferView size = " << _size; } #endif const T* t = (reinterpret_cast (_buffer->getData() + _offset)); @@ -334,13 +335,13 @@ public: template T& edit() { #if _DEBUG if (!_buffer) { - qDebug() << "Accessing null gpu::buffer!"; + qCDebug(gpulogging) << "Accessing null gpu::buffer!"; } if (sizeof(T) > (_buffer->getSize() - _offset)) { - qDebug() << "Accessing buffer in non allocated memory, element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - _offset); + qCDebug(gpulogging) << "Accessing buffer in non allocated memory, element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - _offset); } if (sizeof(T) > _size) { - qDebug() << "Accessing buffer outside the BufferView range, element size = " << sizeof(T) << " when bufferView size = " << _size; + qCDebug(gpulogging) << "Accessing buffer outside the BufferView range, element size = " << sizeof(T) << " when bufferView size = " << _size; } #endif _buffer->markDirty(_offset, sizeof(T)); @@ -352,13 +353,13 @@ public: Resource::Size elementOffset = index * _stride + _offset; #if _DEBUG if (!_buffer) { - qDebug() << "Accessing null gpu::buffer!"; + qCDebug(gpulogging) << "Accessing null gpu::buffer!"; } if (sizeof(T) > (_buffer->getSize() - elementOffset)) { - qDebug() << "Accessing buffer in non allocated memory, index = " << index << ", element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - elementOffset); + qCDebug(gpulogging) << "Accessing buffer in non allocated memory, index = " << index << ", element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - elementOffset); } if (index > getNum()) { - qDebug() << "Accessing buffer outside the BufferView range, index = " << index << " number elements = " << getNum(); + qCDebug(gpulogging) << "Accessing buffer outside the BufferView range, index = " << index << " number elements = " << getNum(); } #endif return *(reinterpret_cast (_buffer->getData() + elementOffset)); @@ -368,13 +369,13 @@ public: Resource::Size elementOffset = index * _stride + _offset; #if _DEBUG if (!_buffer) { - qDebug() << "Accessing null gpu::buffer!"; + qCDebug(gpulogging) << "Accessing null gpu::buffer!"; } if (sizeof(T) > (_buffer->getSize() - elementOffset)) { - qDebug() << "Accessing buffer in non allocated memory, index = " << index << ", element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - elementOffset); + qCDebug(gpulogging) << "Accessing buffer in non allocated memory, index = " << index << ", element size = " << sizeof(T) << " available space in buffer at offset is = " << (_buffer->getSize() - elementOffset); } if (index > getNum()) { - qDebug() << "Accessing buffer outside the BufferView range, index = " << index << " number elements = " << getNum(); + qCDebug(gpulogging) << "Accessing buffer outside the BufferView range, index = " << index << " number elements = " << getNum(); } #endif _buffer->markDirty(elementOffset, sizeof(T)); diff --git a/libraries/gpu/src/gpu/Texture.cpp b/libraries/gpu/src/gpu/Texture.cpp index 19147ca98d..5b0c4c876a 100755 --- a/libraries/gpu/src/gpu/Texture.cpp +++ b/libraries/gpu/src/gpu/Texture.cpp @@ -42,7 +42,7 @@ std::atomic Texture::_enableSparseTextures { recommendedSparseTextures }; struct ReportTextureState { ReportTextureState() { - qDebug() << "[TEXTURE TRANSFER SUPPORT]" + qCDebug(gpulogging) << "[TEXTURE TRANSFER SUPPORT]" << "\n\tidealThreadCount:" << QThread::idealThreadCount() << "\n\tRECOMMENDED enableSparseTextures:" << recommendedSparseTextures; } @@ -50,10 +50,10 @@ struct ReportTextureState { void Texture::setEnableSparseTextures(bool enabled) { #ifdef Q_OS_WIN - qDebug() << "[TEXTURE TRANSFER SUPPORT] SETTING - Enable Sparse Textures and Dynamic Texture Management:" << enabled; + qCDebug(gpulogging) << "[TEXTURE TRANSFER SUPPORT] SETTING - Enable Sparse Textures and Dynamic Texture Management:" << enabled; _enableSparseTextures = enabled; #else - qDebug() << "[TEXTURE TRANSFER SUPPORT] Sparse Textures and Dynamic Texture Management not supported on this platform."; + qCDebug(gpulogging) << "[TEXTURE TRANSFER SUPPORT] Sparse Textures and Dynamic Texture Management not supported on this platform."; #endif } @@ -114,7 +114,7 @@ Texture::Size Texture::getAllowedGPUMemoryUsage() { } void Texture::setAllowedGPUMemoryUsage(Size size) { - qDebug() << "New MAX texture memory " << BYTES_TO_MB(size) << " MB"; + qCDebug(gpulogging) << "New MAX texture memory " << BYTES_TO_MB(size) << " MB"; _allowedCPUMemoryUsage = size; } diff --git a/libraries/model/src/model/TextureMap.cpp b/libraries/model/src/model/TextureMap.cpp index 3957d6c708..ab96a04f31 100755 --- a/libraries/model/src/model/TextureMap.cpp +++ b/libraries/model/src/model/TextureMap.cpp @@ -72,7 +72,7 @@ QImage processSourceImage(const QImage& srcImage, bool cubemap) { } if (targetSize != srcImageSize) { - qDebug() << "Resizing texture from " << srcImageSize.x << "x" << srcImageSize.y << " to " << targetSize.x << "x" << targetSize.y; + qDebug(modelLog) << "Resizing texture from " << srcImageSize.x << "x" << srcImageSize.y << " to " << targetSize.x << "x" << targetSize.y; return srcImage.scaled(fromGlm(targetSize)); } diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 1c3850f8cb..83f1504f00 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -633,7 +633,7 @@ void AccountManager::generateNewKeypair(bool isUserKeypair, const QUuid& domainI _isWaitingForKeypairResponse = true; // clear the current private key - qDebug() << "Clearing current private key in DataServerAccountInfo"; + qCDebug(networking) << "Clearing current private key in DataServerAccountInfo"; _accountInfo.setPrivateKey(QByteArray()); // setup a new QThread to generate the keypair on, in case it takes a while @@ -727,7 +727,7 @@ void AccountManager::processGeneratedKeypair() { } void AccountManager::publicKeyUploadSucceeded(QNetworkReply& reply) { - qDebug() << "Uploaded public key to Metaverse API. RSA keypair generation is completed."; + qCDebug(networking) << "Uploaded public key to Metaverse API. RSA keypair generation is completed."; // public key upload complete - store the matching private key and persist the account to settings _accountInfo.setPrivateKey(_pendingPrivateKey); diff --git a/libraries/networking/src/AssetResourceRequest.cpp b/libraries/networking/src/AssetResourceRequest.cpp index 9a89465e02..540fb4767f 100644 --- a/libraries/networking/src/AssetResourceRequest.cpp +++ b/libraries/networking/src/AssetResourceRequest.cpp @@ -76,7 +76,7 @@ void AssetResourceRequest::requestMappingForPath(const AssetPath& path) { switch (request->getError()) { case MappingRequest::NoError: // we have no error, we should have a resulting hash - use that to send of a request for that asset - qDebug() << "Got mapping for:" << path << "=>" << request->getHash(); + qCDebug(networking) << "Got mapping for:" << path << "=>" << request->getHash(); requestHash(request->getHash()); diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index 5d7340b2ce..c9106c7162 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -247,7 +247,7 @@ void DomainHandler::completedHostnameLookup(const QHostInfo& hostInfo) { } void DomainHandler::completedIceServerHostnameLookup() { - qDebug() << "ICE server socket is at" << _iceServerSockAddr; + qCDebug(networking) << "ICE server socket is at" << _iceServerSockAddr; DependencyManager::get()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetICEServerSocket); @@ -335,7 +335,7 @@ void DomainHandler::processDTLSRequirementPacket(QSharedPointer void DomainHandler::processICEResponsePacket(QSharedPointer message) { if (_icePeer.hasSockets()) { - qDebug() << "Received an ICE peer packet for domain-server but we already have sockets. Not processing."; + qCDebug(networking) << "Received an ICE peer packet for domain-server but we already have sockets. Not processing."; // bail on processing this packet if our ice peer already has sockets return; } diff --git a/libraries/networking/src/FingerprintUtils.cpp b/libraries/networking/src/FingerprintUtils.cpp index 70a2f8ab2c..1990d356b6 100644 --- a/libraries/networking/src/FingerprintUtils.cpp +++ b/libraries/networking/src/FingerprintUtils.cpp @@ -10,6 +10,7 @@ // #include "FingerprintUtils.h" +#include "NetworkLogging.h" #include @@ -42,7 +43,7 @@ QString FingerprintUtils::getMachineFingerprintString() { IOObjectRelease(ioRegistryRoot); uuidString = QString::fromCFString(uuidCf); CFRelease(uuidCf); - qDebug() << "Mac serial number: " << uuidString; + qCDebug(networking) << "Mac serial number: " << uuidString; #endif //Q_OS_MAC #ifdef Q_OS_WIN @@ -53,7 +54,7 @@ QString FingerprintUtils::getMachineFingerprintString() { // users of this lib don't necessarily do so. hres = CoInitializeEx(0, COINIT_MULTITHREADED); if (FAILED(hres)) { - qDebug() << "Failed to initialize COM library!"; + qCDebug(networking) << "Failed to initialize COM library!"; return uuidString; } @@ -65,7 +66,7 @@ QString FingerprintUtils::getMachineFingerprintString() { IID_IWbemLocator, (LPVOID *) &pLoc); if (FAILED(hres)) { - qDebug() << "Failed to initialize WbemLocator"; + qCDebug(networking) << "Failed to initialize WbemLocator"; return uuidString; } @@ -88,7 +89,7 @@ QString FingerprintUtils::getMachineFingerprintString() { if (FAILED(hres)) { pLoc->Release(); - qDebug() << "Failed to connect to WMI"; + qCDebug(networking) << "Failed to connect to WMI"; return uuidString; } @@ -107,7 +108,7 @@ QString FingerprintUtils::getMachineFingerprintString() { if (FAILED(hres)) { pSvc->Release(); pLoc->Release(); - qDebug() << "Failed to set security on proxy blanket"; + qCDebug(networking) << "Failed to set security on proxy blanket"; return uuidString; } @@ -123,7 +124,7 @@ QString FingerprintUtils::getMachineFingerprintString() { if (FAILED(hres)) { pSvc->Release(); pLoc->Release(); - qDebug() << "query to get Win32_ComputerSystemProduct info"; + qCDebug(networking) << "query to get Win32_ComputerSystemProduct info"; return uuidString; } @@ -161,7 +162,7 @@ QString FingerprintUtils::getMachineFingerprintString() { pSvc->Release(); pLoc->Release(); - qDebug() << "Windows BIOS UUID: " << uuidString; + qCDebug(networking) << "Windows BIOS UUID: " << uuidString; #endif //Q_OS_WIN return uuidString; @@ -185,12 +186,12 @@ QUuid FingerprintUtils::getMachineFingerprint() { // read fallback key (if any) Settings settings; uuid = QUuid(settings.value(FALLBACK_FINGERPRINT_KEY).toString()); - qDebug() << "read fallback maching fingerprint: " << uuid.toString(); + qCDebug(networking) << "read fallback maching fingerprint: " << uuid.toString(); if (uuid == QUuid()) { // no fallback yet, set one uuid = QUuid::createUuid(); settings.setValue(FALLBACK_FINGERPRINT_KEY, uuid.toString()); - qDebug() << "no fallback machine fingerprint, setting it to: " << uuid.toString(); + qCDebug(networking) << "no fallback machine fingerprint, setting it to: " << uuid.toString(); } } return uuid; diff --git a/libraries/networking/src/HTTPResourceRequest.cpp b/libraries/networking/src/HTTPResourceRequest.cpp index 64396ec62e..85da5de5b8 100644 --- a/libraries/networking/src/HTTPResourceRequest.cpp +++ b/libraries/networking/src/HTTPResourceRequest.cpp @@ -108,7 +108,7 @@ void HTTPResourceRequest::onRequestFinished() { case QNetworkReply::UnknownServerError: // Script.include('QUrl("https://httpbin.org/status/504")') case QNetworkReply::InternalServerError: // Script.include('QUrl("https://httpbin.org/status/500")') default: - qDebug() << "HTTPResourceRequest error:" << QMetaEnum::fromType().valueToKey(_reply->error()); + qCDebug(networking) << "HTTPResourceRequest error:" << QMetaEnum::fromType().valueToKey(_reply->error()); _result = Error; break; } diff --git a/libraries/networking/src/NetworkPeer.cpp b/libraries/networking/src/NetworkPeer.cpp index abbd262f3d..b52c54c468 100644 --- a/libraries/networking/src/NetworkPeer.cpp +++ b/libraries/networking/src/NetworkPeer.cpp @@ -158,7 +158,7 @@ void NetworkPeer::activateMatchingOrNewSymmetricSocket(const HifiSockAddr& match } void NetworkPeer::softReset() { - qDebug() << "Soft reset "; + qCDebug(networking) << "Soft reset "; // a soft reset should clear the sockets and reset the number of connection attempts _localSocket.clear(); _publicSocket.clear(); diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index f76189b13a..4099ccc034 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -401,7 +401,7 @@ void NodeList::sendDomainServerCheckIn() { if (_numNoReplyDomainCheckIns >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) { // we haven't heard back from DS in MAX_SILENT_DOMAIN_SERVER_CHECK_INS // so emit our signal that says that - qDebug() << "Limit of silent domain checkins reached"; + qCDebug(networking) << "Limit of silent domain checkins reached"; emit limitOfSilentDomainCheckInsReached(); } @@ -629,7 +629,7 @@ void NodeList::processDomainServerAddedNode(QSharedPointer mess void NodeList::processDomainServerRemovedNode(QSharedPointer message) { // read the UUID from the packet, remove it if it exists QUuid nodeUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID)); - qDebug() << "Received packet from domain-server to remove node with UUID" << uuidStringWithoutCurlyBraces(nodeUUID); + qCDebug(networking) << "Received packet from domain-server to remove node with UUID" << uuidStringWithoutCurlyBraces(nodeUUID); killNodeWithUUID(nodeUUID); } @@ -793,7 +793,7 @@ void NodeList::ignoreNodeBySessionID(const QUuid& nodeID) { // write the node ID to the packet ignorePacket->write(nodeID.toRfc4122()); - qDebug() << "Sending packet to ignore node" << uuidStringWithoutCurlyBraces(nodeID); + qCDebug(networking) << "Sending packet to ignore node" << uuidStringWithoutCurlyBraces(nodeID); // send off this ignore packet reliably to the matching node sendPacket(std::move(ignorePacket), *destinationNode); @@ -855,7 +855,7 @@ void NodeList::kickNodeBySessionID(const QUuid& nodeID) { // write the node ID to the packet kickPacket->write(nodeID.toRfc4122()); - qDebug() << "Sending packet to kick node" << uuidStringWithoutCurlyBraces(nodeID); + qCDebug(networking) << "Sending packet to kick node" << uuidStringWithoutCurlyBraces(nodeID); sendPacket(std::move(kickPacket), _domainHandler.getSockAddr()); } else { @@ -880,7 +880,7 @@ void NodeList::muteNodeBySessionID(const QUuid& nodeID) { // write the node ID to the packet mutePacket->write(nodeID.toRfc4122()); - qDebug() << "Sending packet to mute node" << uuidStringWithoutCurlyBraces(nodeID); + qCDebug(networking) << "Sending packet to mute node" << uuidStringWithoutCurlyBraces(nodeID); sendPacket(std::move(mutePacket), *audioMixer); } else { @@ -909,7 +909,7 @@ void NodeList::requestUsernameFromSessionID(const QUuid& nodeID) { usernameFromIDRequestPacket->write(nodeID.toRfc4122()); } - qDebug() << "Sending packet to get username of node" << uuidStringWithoutCurlyBraces(nodeID); + qCDebug(networking) << "Sending packet to get username of node" << uuidStringWithoutCurlyBraces(nodeID); sendPacket(std::move(usernameFromIDRequestPacket), _domainHandler.getSockAddr()); } else { @@ -924,7 +924,7 @@ void NodeList::processUsernameFromIDReply(QSharedPointer messag // read the username from the packet QString username = message->readString(); - qDebug() << "Got username" << username << "for node" << nodeUUIDString; + qCDebug(networking) << "Got username" << username << "for node" << nodeUUIDString; emit usernameFromIDReply(nodeUUIDString, username); } diff --git a/libraries/networking/src/PacketReceiver.cpp b/libraries/networking/src/PacketReceiver.cpp index 21ba7129d4..21db207375 100644 --- a/libraries/networking/src/PacketReceiver.cpp +++ b/libraries/networking/src/PacketReceiver.cpp @@ -324,8 +324,6 @@ void PacketReceiver::handleVerifiedMessage(QSharedPointer recei listenerIsDead = true; } } else { - // qDebug() << "Got verified unsourced packet list: " << QString(nlPacketList->getMessage()); - // one final check on the QPointer before we invoke if (listener.object) { success = listener.method.invoke(listener.object, diff --git a/libraries/networking/src/ResourceManager.cpp b/libraries/networking/src/ResourceManager.cpp index f33dbc161d..439d44c940 100644 --- a/libraries/networking/src/ResourceManager.cpp +++ b/libraries/networking/src/ResourceManager.cpp @@ -22,7 +22,7 @@ #include "FileResourceRequest.h" #include "HTTPResourceRequest.h" #include "NetworkAccessManager.h" - +#include "NetworkLogging.h" QThread ResourceManager::_thread; ResourceManager::PrefixMap ResourceManager::_prefixMap; @@ -51,7 +51,7 @@ QString ResourceManager::normalizeURL(const QString& urlString) { const auto& prefix = entry.first; const auto& replacement = entry.second; if (result.startsWith(prefix)) { - qDebug() << "Replacing " << prefix << " with " << replacement; + qCDebug(networking) << "Replacing " << prefix << " with " << replacement; result.replace(0, prefix.size(), replacement); } } @@ -105,7 +105,7 @@ ResourceRequest* ResourceManager::createResourceRequest(QObject* parent, const Q } else if (scheme == URL_SCHEME_ATP) { request = new AssetResourceRequest(normalizedURL); } else { - qDebug() << "Unknown scheme (" << scheme << ") for URL: " << url.url(); + qCDebug(networking) << "Unknown scheme (" << scheme << ") for URL: " << url.url(); return nullptr; } Q_ASSERT(request); diff --git a/libraries/networking/src/SandboxUtils.cpp b/libraries/networking/src/SandboxUtils.cpp index b16c169baa..bf17a0b1e4 100644 --- a/libraries/networking/src/SandboxUtils.cpp +++ b/libraries/networking/src/SandboxUtils.cpp @@ -27,6 +27,7 @@ #include "SandboxUtils.h" #include "NetworkAccessManager.h" +#include "NetworkLogging.h" void SandboxUtils::ifLocalSandboxRunningElse(std::function localSandboxRunningDoThis, @@ -64,10 +65,10 @@ void SandboxUtils::ifLocalSandboxRunningElse(std::function localSandboxR void SandboxUtils::runLocalSandbox(QString contentPath, bool autoShutdown, QString runningMarkerName, bool noUpdater) { QString applicationDirPath = QFileInfo(QCoreApplication::applicationFilePath()).path(); QString serverPath = applicationDirPath + "/server-console/server-console.exe"; - qDebug() << "Application dir path is: " << applicationDirPath; - qDebug() << "Server path is: " << serverPath; - qDebug() << "autoShutdown: " << autoShutdown; - qDebug() << "noUpdater: " << noUpdater; + qCDebug(networking) << "Application dir path is: " << applicationDirPath; + qCDebug(networking) << "Server path is: " << serverPath; + qCDebug(networking) << "autoShutdown: " << autoShutdown; + qCDebug(networking) << "noUpdater: " << noUpdater; bool hasContentPath = !contentPath.isEmpty(); bool passArgs = autoShutdown || hasContentPath || noUpdater; @@ -92,9 +93,9 @@ void SandboxUtils::runLocalSandbox(QString contentPath, bool autoShutdown, QStri args << "--noUpdater"; } - qDebug() << applicationDirPath; - qDebug() << "Launching sandbox with:" << args; - qDebug() << QProcess::startDetached(serverPath, args); + qCDebug(networking) << applicationDirPath; + qCDebug(networking) << "Launching sandbox with:" << args; + qCDebug(networking) << QProcess::startDetached(serverPath, args); // Sleep a short amount of time to give the server a chance to start usleep(2000000); /// do we really need this?? diff --git a/libraries/networking/src/ThreadedAssignment.cpp b/libraries/networking/src/ThreadedAssignment.cpp index 906bc240e6..e6e3c17db7 100644 --- a/libraries/networking/src/ThreadedAssignment.cpp +++ b/libraries/networking/src/ThreadedAssignment.cpp @@ -18,6 +18,8 @@ #include "ThreadedAssignment.h" +#include "NetworkLogging.h" + ThreadedAssignment::ThreadedAssignment(ReceivedMessage& message) : Assignment(message), _isFinished(false), @@ -42,7 +44,7 @@ void ThreadedAssignment::setFinished(bool isFinished) { if (_isFinished) { - qDebug() << "ThreadedAssignment::setFinished(true) called - finishing up."; + qCDebug(networking) << "ThreadedAssignment::setFinished(true) called - finishing up."; auto nodeList = DependencyManager::get(); @@ -109,7 +111,7 @@ void ThreadedAssignment::checkInWithDomainServerOrExit() { // verify that the number of queued check-ins is not >= our max // the number of queued check-ins is cleared anytime we get a response from the domain-server if (_numQueuedCheckIns >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) { - qDebug() << "At least" << MAX_SILENT_DOMAIN_SERVER_CHECK_INS << "have been queued without a response from domain-server" + qCDebug(networking) << "At least" << MAX_SILENT_DOMAIN_SERVER_CHECK_INS << "have been queued without a response from domain-server" << "Stopping the current assignment"; setFinished(true); } else { @@ -122,6 +124,6 @@ void ThreadedAssignment::checkInWithDomainServerOrExit() { } void ThreadedAssignment::domainSettingsRequestFailed() { - qDebug() << "Failed to retreive settings object from domain-server. Bailing on assignment."; + qCDebug(networking) << "Failed to retreive settings object from domain-server. Bailing on assignment."; setFinished(true); } diff --git a/libraries/networking/src/udt/BasePacket.cpp b/libraries/networking/src/udt/BasePacket.cpp index 8a4b98de87..0540e60a0e 100644 --- a/libraries/networking/src/udt/BasePacket.cpp +++ b/libraries/networking/src/udt/BasePacket.cpp @@ -11,6 +11,8 @@ #include "BasePacket.h" +#include "../NetworkLogging.h" + using namespace udt; const qint64 BasePacket::PACKET_WRITE_ERROR = -1; @@ -131,7 +133,7 @@ void BasePacket::setPayloadSize(qint64 payloadSize) { Q_ASSERT(payloadSize <= _payloadCapacity); _payloadSize = payloadSize; } else { - qDebug() << "You can not call setPayloadSize for a non-writeable Packet."; + qCDebug(networking) << "You can not call setPayloadSize for a non-writeable Packet."; Q_ASSERT(false); } } diff --git a/libraries/networking/src/udt/Packet.cpp b/libraries/networking/src/udt/Packet.cpp index e852332317..f07ea63994 100644 --- a/libraries/networking/src/udt/Packet.cpp +++ b/libraries/networking/src/udt/Packet.cpp @@ -17,6 +17,8 @@ #include "Socket.h" +#include "../NetworkLogging.h" + using namespace udt; int packetMetaTypeId = qRegisterMetaType("Packet*"); @@ -106,7 +108,7 @@ Packet::Packet(std::unique_ptr data, qint64 size, const HifiSockAddr& se } static QString repeatedMessage = LogHandler::getInstance().addRepeatedMessageRegex("^Unobfuscating packet .*"); - qDebug() << qPrintable(debugString); + qCDebug(networking) << qPrintable(debugString); #endif obfuscate(NoObfuscation); // Undo obfuscation diff --git a/libraries/networking/src/udt/PacketList.cpp b/libraries/networking/src/udt/PacketList.cpp index ea84548210..8651f9eed4 100644 --- a/libraries/networking/src/udt/PacketList.cpp +++ b/libraries/networking/src/udt/PacketList.cpp @@ -11,6 +11,8 @@ #include "PacketList.h" +#include "../NetworkLogging.h" + #include using namespace udt; @@ -102,7 +104,7 @@ std::unique_ptr PacketList::createPacketWithExtendedHeader() { if (!_extendedHeader.isEmpty()) { // add the extended header to the front of the packet if (packet->write(_extendedHeader) == -1) { - qDebug() << "Could not write extendedHeader in PacketList::createPacketWithExtendedHeader" + qCDebug(networking) << "Could not write extendedHeader in PacketList::createPacketWithExtendedHeader" << "- make sure that _extendedHeader is not larger than the payload capacity."; } } @@ -195,7 +197,7 @@ qint64 PacketList::writeData(const char* data, qint64 maxSize) { if (segmentSize + sizeRemaining > newPacket->getPayloadCapacity()) { // this is an unsupported case - the segment is bigger than the size of an individual packet // but the PacketList is not going to be sent ordered - qDebug() << "Error in PacketList::writeData - attempted to write a segment to an unordered packet that is" + qCDebug(networking) << "Error in PacketList::writeData - attempted to write a segment to an unordered packet that is" << "larger than the payload size."; Q_ASSERT(false); @@ -220,7 +222,7 @@ qint64 PacketList::writeData(const char* data, qint64 maxSize) { if (sizeRemaining > newPacket->getPayloadCapacity()) { // this is an unsupported case - attempting to write a block of data larger // than the capacity of a new packet in an unordered PacketList - qDebug() << "Error in PacketList::writeData - attempted to write data to an unordered packet that is" + qCDebug(networking) << "Error in PacketList::writeData - attempted to write data to an unordered packet that is" << "larger than the payload size."; Q_ASSERT(false); diff --git a/libraries/networking/src/udt/SendQueue.cpp b/libraries/networking/src/udt/SendQueue.cpp index c330f5516e..82f4084bb2 100644 --- a/libraries/networking/src/udt/SendQueue.cpp +++ b/libraries/networking/src/udt/SendQueue.cpp @@ -33,6 +33,8 @@ #include #include +#include "../NetworkLogging.h" + using namespace udt; using namespace std::chrono; @@ -299,12 +301,12 @@ void SendQueue::run() { // we've already been asked to stop before we even got a chance to start // don't start now #ifdef UDT_CONNECTION_DEBUG - qDebug() << "SendQueue asked to run after being told to stop. Will not run."; + qCDebug(networking) << "SendQueue asked to run after being told to stop. Will not run."; #endif return; } else if (_state == State::Running) { #ifdef UDT_CONNECTION_DEBUG - qDebug() << "SendQueue asked to run but is already running (according to state). Will not re-run."; + qCDebug(networking) << "SendQueue asked to run but is already running (according to state). Will not re-run."; #endif return; } diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index ae75e0fade..357f8a64d8 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -282,7 +282,7 @@ void Socket::clearConnections() { if (_connectionsHash.size() > 0) { // clear all of the current connections in the socket - qDebug() << "Clearing all remaining connections in Socket."; + qCDebug(networking) << "Clearing all remaining connections in Socket."; _connectionsHash.clear(); } } diff --git a/libraries/octree/src/Logging.h b/libraries/octree/src/Logging.h new file mode 100644 index 0000000000..72b5f40c43 --- /dev/null +++ b/libraries/octree/src/Logging.h @@ -0,0 +1,16 @@ +// +// Created by Brad Hefta-Gaub on 2016-12-19 +// Copyright 2013-2016 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_octree_Logging_h +#define hifi_octree_Logging_h + +#include + +Q_DECLARE_LOGGING_CATEGORY(octree) + +#endif // hifi_octree_Logging_h diff --git a/libraries/octree/src/OctreeElement.cpp b/libraries/octree/src/OctreeElement.cpp index abcfd8fbaa..b56edcfcc6 100644 --- a/libraries/octree/src/OctreeElement.cpp +++ b/libraries/octree/src/OctreeElement.cpp @@ -23,6 +23,7 @@ #include #include "AACube.h" +#include "Logging.h" #include "OctalCode.h" #include "Octree.h" #include "OctreeConstants.h" @@ -444,18 +445,12 @@ void OctreeElement::printDebugDetails(const char* label) const { } } - QDebug elementDebug = qDebug().nospace(); - QString resultString; resultString.sprintf("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isDirty=%s shouldRender=%s\n children=", label, (double)_cube.getCorner().x, (double)_cube.getCorner().y, (double)_cube.getCorner().z, (double)_cube.getScale(), debug::valueOf(isLeaf()), debug::valueOf(isDirty()), debug::valueOf(getShouldRender())); - elementDebug << resultString; - - outputBits(childBits, &elementDebug); - qDebug("octalCode="); - printOctalCode(getOctalCode()); + qCDebug(octree).nospace() << resultString; } float OctreeElement::getEnclosingRadius() const { diff --git a/libraries/physics/src/EntityMotionState.cpp b/libraries/physics/src/EntityMotionState.cpp index 951728c4da..1833d0aba4 100644 --- a/libraries/physics/src/EntityMotionState.cpp +++ b/libraries/physics/src/EntityMotionState.cpp @@ -234,7 +234,7 @@ void EntityMotionState::setWorldTransform(const btTransform& worldTrans) { static QString repeatedMessage = LogHandler::getInstance().addRepeatedMessageRegex("EntityMotionState::setWorldTransform " "setPosition failed.*"); - qDebug() << "EntityMotionState::setWorldTransform setPosition failed" << _entity->getID(); + qCDebug(physics) << "EntityMotionState::setWorldTransform setPosition failed" << _entity->getID(); } bool orientationSuccess; _entity->setOrientation(bulletToGLM(worldTrans.getRotation()), orientationSuccess, false); @@ -242,7 +242,7 @@ void EntityMotionState::setWorldTransform(const btTransform& worldTrans) { static QString repeatedMessage = LogHandler::getInstance().addRepeatedMessageRegex("EntityMotionState::setWorldTransform " "setOrientation failed.*"); - qDebug() << "EntityMotionState::setWorldTransform setOrientation failed" << _entity->getID(); + qCDebug(physics) << "EntityMotionState::setWorldTransform setOrientation failed" << _entity->getID(); } _entity->setVelocity(getBodyLinearVelocity()); _entity->setAngularVelocity(getBodyAngularVelocity()); diff --git a/libraries/physics/src/ObjectAction.cpp b/libraries/physics/src/ObjectAction.cpp index ca64cabe5f..140de3a972 100644 --- a/libraries/physics/src/ObjectAction.cpp +++ b/libraries/physics/src/ObjectAction.cpp @@ -13,6 +13,9 @@ #include "ObjectAction.h" +#include "PhysicsLogging.h" + + ObjectAction::ObjectAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity) : btActionInterface(), EntityActionInterface(type, id), @@ -32,7 +35,7 @@ void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar delta }); if (!ownerEntity) { - qDebug() << "warning -- action with no entity removing self from btCollisionWorld."; + qCDebug(physics) << "warning -- action with no entity removing self from btCollisionWorld."; btDynamicsWorld* dynamicsWorld = static_cast(collisionWorld); if (dynamicsWorld) { dynamicsWorld->removeAction(this); @@ -242,7 +245,7 @@ void ObjectAction::activateBody(bool forceActivation) { if (rigidBody) { rigidBody->activate(forceActivation); } else { - qDebug() << "ObjectAction::activateBody -- no rigid body" << (void*)rigidBody; + qCDebug(physics) << "ObjectAction::activateBody -- no rigid body" << (void*)rigidBody; } } diff --git a/libraries/physics/src/ObjectActionOffset.cpp b/libraries/physics/src/ObjectActionOffset.cpp index 5c2999a0a1..f23b3985de 100644 --- a/libraries/physics/src/ObjectActionOffset.cpp +++ b/libraries/physics/src/ObjectActionOffset.cpp @@ -13,6 +13,9 @@ #include "ObjectActionOffset.h" +#include "PhysicsLogging.h" + + const uint16_t ObjectActionOffset::offsetVersion = 1; ObjectActionOffset::ObjectActionOffset(const QUuid& id, EntityItemPointer ownerEntity) : @@ -22,13 +25,13 @@ ObjectActionOffset::ObjectActionOffset(const QUuid& id, EntityItemPointer ownerE _linearTimeScale(FLT_MAX), _positionalTargetSet(false) { #if WANT_DEBUG - qDebug() << "ObjectActionOffset::ObjectActionOffset"; + qCDebug(physics) << "ObjectActionOffset::ObjectActionOffset"; #endif } ObjectActionOffset::~ObjectActionOffset() { #if WANT_DEBUG - qDebug() << "ObjectActionOffset::~ObjectActionOffset"; + qCDebug(physics) << "ObjectActionOffset::~ObjectActionOffset"; #endif } @@ -47,7 +50,7 @@ void ObjectActionOffset::updateActionWorker(btScalar deltaTimeStep) { ObjectMotionState* motionState = static_cast(physicsInfo); btRigidBody* rigidBody = motionState->getRigidBody(); if (!rigidBody) { - qDebug() << "ObjectActionOffset::updateActionWorker no rigidBody"; + qCDebug(physics) << "ObjectActionOffset::updateActionWorker no rigidBody"; return; } diff --git a/libraries/physics/src/ObjectActionSpring.cpp b/libraries/physics/src/ObjectActionSpring.cpp index e67a681481..b22b3c3368 100644 --- a/libraries/physics/src/ObjectActionSpring.cpp +++ b/libraries/physics/src/ObjectActionSpring.cpp @@ -13,6 +13,8 @@ #include "ObjectActionSpring.h" +#include "PhysicsLogging.h" + const float SPRING_MAX_SPEED = 10.0f; const uint16_t ObjectActionSpring::springVersion = 1; @@ -29,13 +31,13 @@ ObjectActionSpring::ObjectActionSpring(const QUuid& id, EntityItemPointer ownerE _angularTimeScale(FLT_MAX), _rotationalTargetSet(true) { #if WANT_DEBUG - qDebug() << "ObjectActionSpring::ObjectActionSpring"; + qCDebug(physics) << "ObjectActionSpring::ObjectActionSpring"; #endif } ObjectActionSpring::~ObjectActionSpring() { #if WANT_DEBUG - qDebug() << "ObjectActionSpring::~ObjectActionSpring"; + qCDebug(physics) << "ObjectActionSpring::~ObjectActionSpring"; #endif } @@ -126,7 +128,7 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) { ObjectMotionState* motionState = static_cast(physicsInfo); btRigidBody* rigidBody = motionState->getRigidBody(); if (!rigidBody) { - qDebug() << "ObjectActionSpring::updateActionWorker no rigidBody"; + qCDebug(physics) << "ObjectActionSpring::updateActionWorker no rigidBody"; return; } diff --git a/libraries/physics/src/ObjectActionTravelOriented.cpp b/libraries/physics/src/ObjectActionTravelOriented.cpp index 18d09d21d9..8f6d45c6f1 100644 --- a/libraries/physics/src/ObjectActionTravelOriented.cpp +++ b/libraries/physics/src/ObjectActionTravelOriented.cpp @@ -13,6 +13,7 @@ #include "QVariantGLM.h" #include "ObjectActionTravelOriented.h" +#include "PhysicsLogging.h" const uint16_t ObjectActionTravelOriented::actionVersion = 1; @@ -20,13 +21,13 @@ const uint16_t ObjectActionTravelOriented::actionVersion = 1; ObjectActionTravelOriented::ObjectActionTravelOriented(const QUuid& id, EntityItemPointer ownerEntity) : ObjectAction(ACTION_TYPE_TRAVEL_ORIENTED, id, ownerEntity) { #if WANT_DEBUG - qDebug() << "ObjectActionTravelOriented::ObjectActionTravelOriented"; + qCDebug(physics) << "ObjectActionTravelOriented::ObjectActionTravelOriented"; #endif } ObjectActionTravelOriented::~ObjectActionTravelOriented() { #if WANT_DEBUG - qDebug() << "ObjectActionTravelOriented::~ObjectActionTravelOriented"; + qCDebug(physics) << "ObjectActionTravelOriented::~ObjectActionTravelOriented"; #endif } @@ -43,7 +44,7 @@ void ObjectActionTravelOriented::updateActionWorker(btScalar deltaTimeStep) { ObjectMotionState* motionState = static_cast(physicsInfo); btRigidBody* rigidBody = motionState->getRigidBody(); if (!rigidBody) { - qDebug() << "ObjectActionTravelOriented::updateActionWorker no rigidBody"; + qCDebug(physics) << "ObjectActionTravelOriented::updateActionWorker no rigidBody"; return; } const float MAX_TIMESCALE = 600.0f; // 10 min is a long time diff --git a/libraries/procedural/src/procedural/Logging.h b/libraries/procedural/src/procedural/Logging.h new file mode 100644 index 0000000000..3684d7c78f --- /dev/null +++ b/libraries/procedural/src/procedural/Logging.h @@ -0,0 +1,16 @@ +// +// Created by Brad Hefta-Gaub on 2016-12-19 +// Copyright 2013-2016 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_octree_Logging_h +#define hifi_octree_Logging_h + +#include + +Q_DECLARE_LOGGING_CATEGORY(procedural) + +#endif // hifi_octree_Logging_h diff --git a/libraries/procedural/src/procedural/Procedural.cpp b/libraries/procedural/src/procedural/Procedural.cpp index a995ad5b2f..ac6163c227 100644 --- a/libraries/procedural/src/procedural/Procedural.cpp +++ b/libraries/procedural/src/procedural/Procedural.cpp @@ -21,6 +21,8 @@ #include "ProceduralCommon_frag.h" +#include "Logging.h" + // Userdata parsing constants static const QString PROCEDURAL_USER_DATA_KEY = "ProceduralEntity"; static const QString URL_KEY = "shaderUrl"; @@ -122,14 +124,16 @@ bool Procedural::parseShader(const QUrl& shaderPath) { if (_shaderUrl.isLocalFile()) { _shaderPath = _shaderUrl.toLocalFile(); #if WANT_DEBUG - qDebug() << "Shader path: " << _shaderPath; + qCDebug(procedural) << "Shader path: " << _shaderPath; #endif if (!QFile(_shaderPath).exists()) { _networkShader.reset(); return false;; } } else { - qDebug() << "Shader url: " << _shaderUrl; +#if WANT_DEBUG + qCDebug(procedural) << "Shader url: " << _shaderUrl; +#endif _networkShader = ShaderCache::instance().getShader(_shaderUrl); } @@ -271,7 +275,7 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm } // Leave this here for debugging - // qDebug() << "FragmentShader:\n" << fragmentShaderSource.c_str(); + // qCDebug(procedural) << "FragmentShader:\n" << fragmentShaderSource.c_str(); _fragmentShader = gpu::Shader::createPixel(fragmentShaderSource); _shader = gpu::Shader::createProgram(_vertexShader, _fragmentShader); diff --git a/libraries/recording/src/recording/Clip.cpp b/libraries/recording/src/recording/Clip.cpp index 1451724f23..27b6a2b6c9 100644 --- a/libraries/recording/src/recording/Clip.cpp +++ b/libraries/recording/src/recording/Clip.cpp @@ -9,6 +9,7 @@ #include "Clip.h" #include "Frame.h" +#include "Logging.h" #include "impl/FileClip.h" #include "impl/BufferClip.h" @@ -64,7 +65,7 @@ bool writeFrame(QIODevice& output, const Frame& frame, bool compressed = true) { if (written != sizeof(FrameType)) { return false; } - //qDebug() << "Writing frame with time offset " << frame.timeOffset; + //qDebug(recordingLog) << "Writing frame with time offset " << frame.timeOffset; written = output.write((char*)&(frame.timeOffset), sizeof(Frame::Time)); if (written != sizeof(Frame::Time)) { return false; diff --git a/libraries/recording/src/recording/impl/BufferClip.cpp b/libraries/recording/src/recording/impl/BufferClip.cpp index c40d9dd42a..fca4f3ce5e 100644 --- a/libraries/recording/src/recording/impl/BufferClip.cpp +++ b/libraries/recording/src/recording/impl/BufferClip.cpp @@ -33,7 +33,7 @@ void BufferClip::addFrame(FrameConstPointer newFrame) { ); auto newFrameIndex = itr - _frames.begin(); - //qDebug() << "Adding frame with time offset " << newFrame->timeOffset << " @ index " << newFrameIndex; + //qDebug(recordingLog) << "Adding frame with time offset " << newFrame->timeOffset << " @ index " << newFrameIndex; _frames.insert(_frames.begin() + newFrameIndex, Frame(*newFrame)); } diff --git a/libraries/recording/src/recording/impl/FileClip.cpp b/libraries/recording/src/recording/impl/FileClip.cpp index b153f5aa4a..7cfd7648fd 100644 --- a/libraries/recording/src/recording/impl/FileClip.cpp +++ b/libraries/recording/src/recording/impl/FileClip.cpp @@ -23,7 +23,7 @@ using namespace recording; FileClip::FileClip(const QString& fileName) : _file(fileName) { auto size = _file.size(); - qDebug() << "Opening file of size: " << size; + qDebug(recordingLog) << "Opening file of size: " << size; bool opened = _file.open(QIODevice::ReadOnly); if (!opened) { qCWarning(recordingLog) << "Unable to open file " << fileName; diff --git a/libraries/recording/src/recording/impl/PointerClip.cpp b/libraries/recording/src/recording/impl/PointerClip.cpp index 6f74391b4b..bd632a3f4a 100644 --- a/libraries/recording/src/recording/impl/PointerClip.cpp +++ b/libraries/recording/src/recording/impl/PointerClip.cpp @@ -32,7 +32,7 @@ FrameTranslationMap parseTranslationMap(const QJsonDocument& doc) { auto frameTypeObj = headerObj[Clip::FRAME_TYPE_MAP].toObject(); auto currentFrameTypes = Frame::getFrameTypes(); for (auto frameTypeName : frameTypeObj.keys()) { - qDebug() << frameTypeName; + qDebug(recordingLog) << frameTypeName; if (!currentFrameTypes.contains(frameTypeName)) { continue; } @@ -67,10 +67,10 @@ PointerFrameHeaderList parseFrameHeaders(uchar* const start, const size_t& size) current += header.size; results.push_back(header); } - qDebug() << "Parsed source data into " << results.size() << " frames"; + qDebug(recordingLog) << "Parsed source data into " << results.size() << " frames"; // int i = 0; // for (const auto& frameHeader : results) { -// qDebug() << "Frame " << i++ << " time " << frameHeader.timeOffset << " Type " << frameHeader.type; +// qDebug(recordingLog) << "Frame " << i++ << " time " << frameHeader.timeOffset << " Type " << frameHeader.type; // } return results; } diff --git a/libraries/render-utils/src/FboCache.cpp b/libraries/render-utils/src/FboCache.cpp index b6cca8116b..ff779f0b85 100644 --- a/libraries/render-utils/src/FboCache.cpp +++ b/libraries/render-utils/src/FboCache.cpp @@ -15,6 +15,7 @@ #include #include #include "ThreadHelpers.h" +#include "RenderUtilsLogging.h" FboCache::FboCache() { // Why do we even HAVE that lever? @@ -61,7 +62,7 @@ QOpenGLFramebufferObject* FboCache::getReadyFbo() { _destroyFboQueue.clear(); if (_readyFboQueue.empty()) { - qDebug() << "Building new offscreen FBO number " << _fboMap.size() + 1; + qCDebug(renderutils) << "Building new offscreen FBO number " << _fboMap.size() + 1; result = new QOpenGLFramebufferObject(_size, QOpenGLFramebufferObject::CombinedDepthStencil); _fboMap[result->texture()] = QSharedPointer(result); _readyFboQueue.push_back(result); diff --git a/libraries/render-utils/src/LightClusters.cpp b/libraries/render-utils/src/LightClusters.cpp index b9ba309fd5..d6c20f8f28 100644 --- a/libraries/render-utils/src/LightClusters.cpp +++ b/libraries/render-utils/src/LightClusters.cpp @@ -9,6 +9,7 @@ // #include "LightClusters.h" +#include "RenderUtilsLogging.h" #include @@ -327,7 +328,7 @@ uint32_t scanLightVolumeSphere(FrustumGrid& grid, const FrustumGrid::Planes plan clusterGrid[index].emplace_back(lightId); numClustersTouched++; } else { - qDebug() << "WARNING: LightClusters::scanLightVolumeSphere invalid index found ? numClusters = " << clusterGrid.size() << " index = " << index << " found from cluster xyz = " << x << " " << y << " " << z; + qCDebug(renderutils) << "WARNING: LightClusters::scanLightVolumeSphere invalid index found ? numClusters = " << clusterGrid.size() << " index = " << index << " found from cluster xyz = " << x << " " << y << " " << z; } } } diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 03abfb35e4..bee7111150 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1293,7 +1293,7 @@ void Model::createVisibleRenderItemSet() { // all of our mesh vectors must match in size if ((int)meshes.size() != _meshStates.size()) { - qDebug() << "WARNING!!!! Mesh Sizes don't match! We will not segregate mesh groups yet."; + qCDebug(renderlogging) << "WARNING!!!! Mesh Sizes don't match! We will not segregate mesh groups yet."; return; } diff --git a/libraries/render/src/render/DrawTask.cpp b/libraries/render/src/render/DrawTask.cpp index 221251dae6..1c9a92c511 100755 --- a/libraries/render/src/render/DrawTask.cpp +++ b/libraries/render/src/render/DrawTask.cpp @@ -10,6 +10,7 @@ // #include "DrawTask.h" +#include "Logging.h" #include #include @@ -46,7 +47,7 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons } else if (key.hasOwnPipeline()) { item.render(args); } else { - qDebug() << "Item could not be rendered with invalid key" << key; + qCDebug(renderlogging) << "Item could not be rendered with invalid key" << key; } } @@ -96,7 +97,7 @@ void render::renderStateSortShapes(const SceneContextPointer& sceneContext, cons } else if (key.hasOwnPipeline()) { ownPipelineBucket.push_back(item); } else { - qDebug() << "Item could not be rendered with invalid key" << key; + qCDebug(renderlogging) << "Item could not be rendered with invalid key" << key; } } } diff --git a/libraries/render/src/render/Engine.cpp b/libraries/render/src/render/Engine.cpp index b955205a1a..3c9f2b643a 100644 --- a/libraries/render/src/render/Engine.cpp +++ b/libraries/render/src/render/Engine.cpp @@ -18,6 +18,7 @@ #include #include "EngineStats.h" +#include "Logging.h" using namespace render; @@ -44,7 +45,7 @@ void Engine::load() { QJsonDocument doc = QJsonDocument::fromJson(data.toUtf8(), &error); if (error.error == error.NoError) { config->setPresetList(doc.object()); - qDebug() << "Engine configuration file" << path << "loaded"; + qCDebug(renderlogging) << "Engine configuration file" << path << "loaded"; } else { qWarning() << "Engine configuration file" << path << "failed to load:" << error.errorString() << "at offset" << error.offset; diff --git a/libraries/render/src/render/Scene.cpp b/libraries/render/src/render/Scene.cpp index 9ff7120508..f918fc0bf6 100644 --- a/libraries/render/src/render/Scene.cpp +++ b/libraries/render/src/render/Scene.cpp @@ -21,7 +21,7 @@ void PendingChanges::resetItem(ItemID id, const PayloadPointer& payload) { _resetItems.push_back(id); _resetPayloads.push_back(payload); } else { - qDebug() << "WARNING: PendingChanges::resetItem with a null payload!"; + qCDebug(renderlogging) << "WARNING: PendingChanges::resetItem with a null payload!"; removeItem(id); } } @@ -50,7 +50,7 @@ Scene::Scene(glm::vec3 origin, float size) : } Scene::~Scene() { - qDebug() << "Scene::~Scene()"; + qCDebug(renderlogging) << "Scene::~Scene()"; } ItemID Scene::allocateID() { diff --git a/libraries/render/src/render/ShapePipeline.cpp b/libraries/render/src/render/ShapePipeline.cpp index 4bab517e30..48e8ee43d5 100644 --- a/libraries/render/src/render/ShapePipeline.cpp +++ b/libraries/render/src/render/ShapePipeline.cpp @@ -10,7 +10,7 @@ // #include "DependencyManager.h" - +#include "Logging.h" #include "ShapePipeline.h" #include @@ -107,7 +107,7 @@ const ShapePipelinePointer ShapePlumber::pickPipeline(RenderArgs* args, const Ke // The first time we can't find a pipeline, we should log it if (_missingKeys.find(key) == _missingKeys.end()) { _missingKeys.insert(key); - qDebug() << "Couldn't find a pipeline for" << key; + qCDebug(renderlogging) << "Couldn't find a pipeline for" << key; } return PipelinePointer(nullptr); } diff --git a/libraries/script-engine/src/FileScriptingInterface.cpp b/libraries/script-engine/src/FileScriptingInterface.cpp index ad6a3cdf6f..14278837d3 100644 --- a/libraries/script-engine/src/FileScriptingInterface.cpp +++ b/libraries/script-engine/src/FileScriptingInterface.cpp @@ -22,9 +22,10 @@ #include #include #include -#include "ResourceManager.h" #include "FileScriptingInterface.h" +#include "ResourceManager.h" +#include "ScriptEngineLogging.h" FileScriptingInterface::FileScriptingInterface(QObject* parent) : QObject(parent) { @@ -32,26 +33,26 @@ FileScriptingInterface::FileScriptingInterface(QObject* parent) : QObject(parent } void FileScriptingInterface::runUnzip(QString path, QUrl url) { - qDebug() << "Url that was downloaded: " + url.toString(); - qDebug() << "Path where download is saved: " + path; + qCDebug(scriptengine) << "Url that was downloaded: " + url.toString(); + qCDebug(scriptengine) << "Path where download is saved: " + path; QString fileName = "/" + path.section("/", -1); QString tempDir = path; tempDir.remove(fileName); - qDebug() << "Temporary directory at: " + tempDir; + qCDebug(scriptengine) << "Temporary directory at: " + tempDir; if (!isTempDir(tempDir)) { - qDebug() << "Temporary directory mismatch; risk of losing files"; + qCDebug(scriptengine) << "Temporary directory mismatch; risk of losing files"; return; } QString file = unzipFile(path, tempDir); if (file != "") { - qDebug() << "Object file to upload: " + file; + qCDebug(scriptengine) << "Object file to upload: " + file; QUrl url = QUrl::fromLocalFile(file); emit unzipSuccess(url.toString()); } else { - qDebug() << "unzip failed"; + qCDebug(scriptengine) << "unzip failed"; } - qDebug() << "Removing temporary directory at: " + tempDir; + qCDebug(scriptengine) << "Removing temporary directory at: " + tempDir; QDir(tempDir).removeRecursively(); } @@ -94,7 +95,7 @@ QString FileScriptingInterface::convertUrlToPath(QUrl url) { QString newUrl; QString oldUrl = url.toString(); newUrl = oldUrl.section("filename=", 1, 1); - qDebug() << "Filename should be: " + newUrl; + qCDebug(scriptengine) << "Filename should be: " + newUrl; return newUrl; } @@ -116,12 +117,12 @@ QString FileScriptingInterface::unzipFile(QString path, QString tempDir) { QString target = tempDir + "/model_repo"; QStringList list = JlCompress::extractDir(dirName, target); - qDebug() << list; + qCDebug(scriptengine) << list; if (!list.isEmpty()) { return list.front(); } else { - qDebug() << "Extraction failed"; + qCDebug(scriptengine) << "Extraction failed"; return ""; } @@ -130,13 +131,13 @@ QString FileScriptingInterface::unzipFile(QString path, QString tempDir) { // this function is not in use void FileScriptingInterface::recursiveFileScan(QFileInfo file, QString* dirName) { /*if (!file.isDir()) { - qDebug() << "Regular file logged: " + file.fileName(); + qCDebug(scriptengine) << "Regular file logged: " + file.fileName(); return; }*/ QFileInfoList files; if (file.fileName().contains(".zip")) { - qDebug() << "Extracting archive: " + file.fileName(); + qCDebug(scriptengine) << "Extracting archive: " + file.fileName(); JlCompress::extractDir(file.fileName()); } files = file.dir().entryInfoList(); @@ -146,7 +147,7 @@ void FileScriptingInterface::recursiveFileScan(QFileInfo file, QString* dirName) }*/ foreach (QFileInfo file, files) { - qDebug() << "Looking into file: " + file.fileName(); + qCDebug(scriptengine) << "Looking into file: " + file.fileName(); recursiveFileScan(file, dirName); } return; diff --git a/libraries/script-engine/src/ScriptCache.cpp b/libraries/script-engine/src/ScriptCache.cpp index 9a2046beed..19534526c0 100644 --- a/libraries/script-engine/src/ScriptCache.cpp +++ b/libraries/script-engine/src/ScriptCache.cpp @@ -212,11 +212,11 @@ void ScriptCache::scriptContentAvailable() { if (!irrecoverable) { ++scriptRequest.numRetries; - qDebug() << "Script request failed: " << url; + qCDebug(scriptengine) << "Script request failed: " << url; int timeout = exp(scriptRequest.numRetries) * START_DELAY_BETWEEN_RETRIES; QTimer::singleShot(timeout, this, [this, url]() { - qDebug() << "Retrying script request: " << url; + qCDebug(scriptengine) << "Retrying script request: " << url; auto request = ResourceManager::createResourceRequest(nullptr, url); Q_ASSERT(request); diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 45069b6391..ef0da5b248 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -551,7 +551,7 @@ void ScriptEngine::init() { void ScriptEngine::registerValue(const QString& valueName, QScriptValue value) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::registerValue() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerValue() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; #endif QMetaObject::invokeMethod(this, "registerValue", Q_ARG(const QString&, valueName), @@ -581,7 +581,7 @@ void ScriptEngine::registerValue(const QString& valueName, QScriptValue value) { void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::registerGlobalObject() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerGlobalObject() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; #endif QMetaObject::invokeMethod(this, "registerGlobalObject", Q_ARG(const QString&, name), @@ -589,7 +589,7 @@ void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::registerGlobalObject() called on thread [" << QThread::currentThread() << "] name:" << name; + qCDebug(scriptengine) << "ScriptEngine::registerGlobalObject() called on thread [" << QThread::currentThread() << "] name:" << name; #endif if (!globalObject().property(name).isValid()) { @@ -605,7 +605,7 @@ void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { void ScriptEngine::registerFunction(const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; #endif QMetaObject::invokeMethod(this, "registerFunction", Q_ARG(const QString&, name), @@ -614,7 +614,7 @@ void ScriptEngine::registerFunction(const QString& name, QScriptEngine::Function return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] name:" << name; + qCDebug(scriptengine) << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] name:" << name; #endif QScriptValue scriptFun = newFunction(functionSignature, numArguments); @@ -624,7 +624,7 @@ void ScriptEngine::registerFunction(const QString& name, QScriptEngine::Function void ScriptEngine::registerFunction(const QString& parent, const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] parent:" << parent << "name:" << name; + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] parent:" << parent << "name:" << name; #endif QMetaObject::invokeMethod(this, "registerFunction", Q_ARG(const QString&, name), @@ -633,7 +633,7 @@ void ScriptEngine::registerFunction(const QString& parent, const QString& name, return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] parent:" << parent << "name:" << name; + qCDebug(scriptengine) << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] parent:" << parent << "name:" << name; #endif QScriptValue object = globalObject().property(parent); @@ -647,7 +647,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func QScriptEngine::FunctionSignature setter, const QString& parent) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " " name:" << name << "parent:" << parent; #endif QMetaObject::invokeMethod(this, "registerGetterSetter", @@ -658,7 +658,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::registerGetterSetter() called on thread [" << QThread::currentThread() << "] name:" << name << "parent:" << parent; + qCDebug(scriptengine) << "ScriptEngine::registerGetterSetter() called on thread [" << QThread::currentThread() << "] name:" << name << "parent:" << parent; #endif QScriptValue setterFunction = newFunction(setter, 1); @@ -680,7 +680,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::removeEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::removeEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "entityID:" << entityID << " eventName:" << eventName; #endif QMetaObject::invokeMethod(this, "removeEventHandler", @@ -690,7 +690,7 @@ void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QStrin return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::removeEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; + qCDebug(scriptengine) << "ScriptEngine::removeEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; #endif if (!_registeredHandlers.contains(entityID)) { @@ -710,7 +710,7 @@ void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QStrin void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::addEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::addEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "entityID:" << entityID << " eventName:" << eventName; #endif @@ -721,7 +721,7 @@ void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::addEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; + qCDebug(scriptengine) << "ScriptEngine::addEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName; #endif if (_registeredHandlers.count() == 0) { // First time any per-entity handler has been added in this script... @@ -796,7 +796,7 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi if (QThread::currentThread() != thread()) { QScriptValue result; #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::evaluate() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::evaluate() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "sourceCode:" << sourceCode << " fileName:" << fileName << "lineNumber:" << lineNumber; #endif QMetaObject::invokeMethod(this, "evaluate", Qt::BlockingQueuedConnection, @@ -1010,7 +1010,7 @@ void ScriptEngine::stop(bool marshal) { void ScriptEngine::callAnimationStateHandler(QScriptValue callback, AnimVariantMap parameters, QStringList names, bool useNames, AnimVariantResultHandler resultHandler) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::callAnimationStateHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callAnimationStateHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; #endif QMetaObject::invokeMethod(this, "callAnimationStateHandler", Q_ARG(QScriptValue, callback), @@ -1182,7 +1182,7 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac thisURL = expandScriptUrl(QUrl::fromLocalFile(expandScriptPath(file))); QUrl defaultScriptsLoc = defaultScriptsLocation(); if (!defaultScriptsLoc.isParentOf(thisURL)) { - qDebug() << "ScriptEngine::include -- skipping" << file << "-- outside of standard libraries"; + qCDebug(scriptengine) << "ScriptEngine::include -- skipping" << file << "-- outside of standard libraries"; continue; } isStandardLibrary = true; @@ -1297,7 +1297,7 @@ void ScriptEngine::load(const QString& loadFile) { // Look up the handler associated with eventName and entityID. If found, evalute the argGenerator thunk and call the handler with those args void ScriptEngine::forwardHandlerCall(const EntityItemID& entityID, const QString& eventName, QScriptValueList eventHandlerArgs) { if (QThread::currentThread() != thread()) { - qDebug() << "*** ERROR *** ScriptEngine::forwardHandlerCall() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; + qCDebug(scriptengine) << "*** ERROR *** ScriptEngine::forwardHandlerCall() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; assert(false); return ; } @@ -1331,7 +1331,7 @@ void ScriptEngine::loadEntityScript(QWeakPointer theEngine, const QSharedPointer strongEngine = theEngine.toStrongRef(); if (strongEngine) { #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread [" + qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread [" << QThread::currentThread() << "] expected thread [" << strongEngine->thread() << "]"; #endif strongEngine->entityScriptContentAvailable(entityID, scriptOrURL, contents, isURL, success); @@ -1344,7 +1344,7 @@ void ScriptEngine::loadEntityScript(QWeakPointer theEngine, const void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, const QString& scriptOrURL, const QString& contents, bool isURL, bool success) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::entityScriptContentAvailable() called on wrong thread [" + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::entityScriptContentAvailable() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "entityID:" << entityID << "scriptOrURL:" << scriptOrURL << "contents:" << contents << "isURL:" << isURL << "success:" << success; @@ -1360,7 +1360,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::entityScriptContentAvailable() thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]"; + qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable() thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]"; #endif auto scriptCache = DependencyManager::get(); @@ -1448,7 +1448,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::unloadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "entityID:" << entityID; #endif @@ -1457,7 +1457,7 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::unloadEntityScript() called on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "ScriptEngine::unloadEntityScript() called on correct thread [" << thread() << "] " "entityID:" << entityID; #endif @@ -1471,14 +1471,14 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { void ScriptEngine::unloadAllEntityScripts() { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; #endif QMetaObject::invokeMethod(this, "unloadAllEntityScripts"); return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::unloadAllEntityScripts() called on correct thread [" << thread() << "]"; + qCDebug(scriptengine) << "ScriptEngine::unloadAllEntityScripts() called on correct thread [" << thread() << "]"; #endif foreach(const EntityItemID& entityID, _entityScripts.keys()) { callEntityScriptMethod(entityID, "unload"); @@ -1486,13 +1486,13 @@ void ScriptEngine::unloadAllEntityScripts() { _entityScripts.clear(); #ifdef DEBUG_ENGINE_STATE - qDebug() << "---- CURRENT STATE OF ENGINE: --------------------------"; + qCDebug(scriptengine) << "---- CURRENT STATE OF ENGINE: --------------------------"; QScriptValueIterator it(globalObject()); while (it.hasNext()) { it.next(); - qDebug() << it.name() << ":" << it.value().toString(); + qCDebug(scriptengine) << it.name() << ":" << it.value().toString(); } - qDebug() << "--------------------------------------------------------"; + qCDebug(scriptengine) << "--------------------------------------------------------"; #endif // DEBUG_ENGINE_STATE } @@ -1563,7 +1563,7 @@ void ScriptEngine::callWithEnvironment(const EntityItemID& entityID, const QUrl& void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const QStringList& params) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "entityID:" << entityID << "methodName:" << methodName; #endif @@ -1574,7 +1574,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " "entityID:" << entityID << "methodName:" << methodName; #endif @@ -1595,7 +1595,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const PointerEvent& event) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent"; #endif @@ -1606,7 +1606,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " "entityID:" << entityID << "methodName:" << methodName << "event: pointerEvent"; #endif @@ -1627,7 +1627,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const EntityItemID& otherID, const Collision& collision) { if (QThread::currentThread() != thread()) { #ifdef THREAD_DEBUGGING - qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision"; #endif @@ -1639,7 +1639,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS return; } #ifdef THREAD_DEBUGGING - qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " + qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] " "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision"; #endif diff --git a/libraries/script-engine/src/ScriptsModel.cpp b/libraries/script-engine/src/ScriptsModel.cpp index 8755195932..82ca26a03a 100644 --- a/libraries/script-engine/src/ScriptsModel.cpp +++ b/libraries/script-engine/src/ScriptsModel.cpp @@ -205,7 +205,7 @@ void ScriptsModel::downloadFinished() { qCDebug(scriptengine) << "Error: Received no data when loading default scripts"; } } else { - qDebug() << "Error: when loading default scripts --" << reply->error(); + qCDebug(scriptengine) << "Error: when loading default scripts --" << reply->error(); } reply->deleteLater(); diff --git a/libraries/shared/src/CrashHelpers.h b/libraries/shared/src/CrashHelpers.h index 6233ab9177..1cc6749182 100644 --- a/libraries/shared/src/CrashHelpers.h +++ b/libraries/shared/src/CrashHelpers.h @@ -14,6 +14,8 @@ #ifndef hifi_CrashHelpers_h #define hifi_CrashHelpers_h +#include "SharedLogging.h" + namespace crash { class B; @@ -38,36 +40,36 @@ A::~A() { } void pureVirtualCall() { - qDebug() << "About to make a pure virtual call"; + qCDebug(shared) << "About to make a pure virtual call"; B b; } void doubleFree() { - qDebug() << "About to double delete memory"; + qCDebug(shared) << "About to double delete memory"; int* blah = new int(200); delete blah; delete blah; } void nullDeref() { - qDebug() << "About to dereference a null pointer"; + qCDebug(shared) << "About to dereference a null pointer"; int* p = nullptr; *p = 1; } void doAbort() { - qDebug() << "About to abort"; + qCDebug(shared) << "About to abort"; abort(); } void outOfBoundsVectorCrash() { - qDebug() << "std::vector out of bounds crash!"; + qCDebug(shared) << "std::vector out of bounds crash!"; std::vector v; v[0] = 42; } void newFault() { - qDebug() << "About to crash inside new fault"; + qCDebug(shared) << "About to crash inside new fault"; // Force crash with multiple large allocations while (true) { diff --git a/libraries/shared/src/Debug.h b/libraries/shared/src/Debug.h index 55d6d7975d..d817ccb69c 100644 --- a/libraries/shared/src/Debug.h +++ b/libraries/shared/src/Debug.h @@ -157,15 +157,15 @@ void Counter::log() { } } - qDebug() << "Counts for" << _name; + qCDebug(shared) << "Counts for" << _name; for (const auto& entry : results) { - qDebug() << entry.first << '\t' << entry.second << "entries"; + qCDebug(shared) << entry.first << '\t' << entry.second << "entries"; } if (_logLevel == LogLevel::SUMMARY) return; - qDebug() << "Entries"; + qCDebug(shared) << "Entries"; for (const auto& entry : _map) { - qDebug() << entry.first << '\t' << entry.second; + qCDebug(shared) << entry.first << '\t' << entry.second; } if (_logLevel == LogLevel::DETAILED) return; } @@ -208,7 +208,7 @@ void Tracker::set(const K& k, const size_t& v) { it->second = v; } else { // Unordered entry for k; dump log and fail - qDebug() << "Badly ordered entry detected:" << + qCDebug(shared) << "Badly ordered entry detected:" << k << _legend.at(it->second).c_str() << "->" << _legend.at(v).c_str(); log(); assert(false); @@ -226,9 +226,9 @@ void Tracker::log() { results.at(entry.second).push_back(entry.first); } - qDebug() << "Summary of" << _name; + qCDebug(shared) << "Summary of" << _name; for (auto i = 0; i < results.size(); ++i) { - qDebug() << _legend.at(i) << '\t' << results[i].size() << "entries"; + qCDebug(shared) << _legend.at(i) << '\t' << results[i].size() << "entries"; } if (_logLevel == LogLevel::SUMMARY) return; @@ -236,16 +236,16 @@ void Tracker::log() { for (const auto& entry : _duplicates) { size += entry.second.size(); } - qDebug() << "Duplicates" << size << "entries"; + qCDebug(shared) << "Duplicates" << size << "entries"; // TODO: Add more detail to duplicate logging if (_logLevel <= LogLevel::DUPLICATES) return; - qDebug() << "Entries"; + qCDebug(shared) << "Entries"; // Don't log the terminal case for (auto i = 0; i < _max; ++i) { - qDebug() << "----" << _legend.at(i) << "----"; + qCDebug(shared) << "----" << _legend.at(i) << "----"; for (const auto& entry : results[i]) { - qDebug() << "\t" << entry; + qCDebug(shared) << "\t" << entry; } } if (_logLevel <= LogLevel::DETAILED) return; diff --git a/libraries/shared/src/HifiConfigVariantMap.cpp b/libraries/shared/src/HifiConfigVariantMap.cpp index a1be6db448..5be6b2cd74 100644 --- a/libraries/shared/src/HifiConfigVariantMap.cpp +++ b/libraries/shared/src/HifiConfigVariantMap.cpp @@ -156,13 +156,13 @@ void HifiConfigVariantMap::loadConfig(const QStringList& argumentList) { auto dataDirectory = ServerPathUtils::getDataDirectory(); if (QDir().mkpath(dataDirectory)) { if (oldConfigFile.copy(_userConfigFilename)) { - qDebug() << "Migrated config file from" << oldConfigFilename << "to" << _userConfigFilename; + qCDebug(shared) << "Migrated config file from" << oldConfigFilename << "to" << _userConfigFilename; } else { - qWarning() << "Could not copy previous config file from" << oldConfigFilename << "to" << _userConfigFilename + qCWarning(shared) << "Could not copy previous config file from" << oldConfigFilename << "to" << _userConfigFilename << "- please try to copy manually and restart."; } } else { - qWarning() << "Could not create application data directory" << dataDirectory << "- unable to migrate previous config file."; + qCWarning(shared) << "Could not create application data directory" << dataDirectory << "- unable to migrate previous config file."; } } } diff --git a/libraries/shared/src/PerfStat.cpp b/libraries/shared/src/PerfStat.cpp index d202fdb248..13b3d44eda 100644 --- a/libraries/shared/src/PerfStat.cpp +++ b/libraries/shared/src/PerfStat.cpp @@ -129,7 +129,7 @@ void PerformanceTimer::setActive(bool active) { _records.clear(); } - qDebug() << "PerformanceTimer has been turned" << ((active) ? "on" : "off"); + qCDebug(shared) << "PerformanceTimer has been turned" << ((active) ? "on" : "off"); } } diff --git a/libraries/shared/src/PropertyFlags.h b/libraries/shared/src/PropertyFlags.h index 833f06aa2b..28c0536593 100644 --- a/libraries/shared/src/PropertyFlags.h +++ b/libraries/shared/src/PropertyFlags.h @@ -26,7 +26,7 @@ #include #include "ByteCountCoding.h" -#include +#include "SharedLogging.h" templateclass PropertyFlags { public: @@ -255,14 +255,14 @@ template inline size_t PropertyFlags::decode(const QByteArr } template inline void PropertyFlags::debugDumpBits() { - qDebug() << "_minFlag=" << _minFlag; - qDebug() << "_maxFlag=" << _maxFlag; - qDebug() << "_trailingFlipped=" << _trailingFlipped; + qCDebug(shared) << "_minFlag=" << _minFlag; + qCDebug(shared) << "_maxFlag=" << _maxFlag; + qCDebug(shared) << "_trailingFlipped=" << _trailingFlipped; QString bits; for(int i = 0; i < _flags.size(); i++) { bits += (_flags.at(i) ? "1" : "0"); } - qDebug() << "bits:" << bits; + qCDebug(shared) << "bits:" << bits; } diff --git a/libraries/shared/src/SettingHelpers.cpp b/libraries/shared/src/SettingHelpers.cpp index f7d2510458..9e2d15fcd0 100644 --- a/libraries/shared/src/SettingHelpers.cpp +++ b/libraries/shared/src/SettingHelpers.cpp @@ -21,6 +21,7 @@ #include #include +#include "SharedLogging.h" QSettings::SettingsMap jsonDocumentToVariantMap(const QJsonDocument& document); QJsonDocument variantMapToJsonDocument(const QSettings::SettingsMap& map); @@ -32,7 +33,7 @@ bool readJSONFile(QIODevice& device, QSettings::SettingsMap& map) { auto document = QJsonDocument::fromJson(bytesRead, &jsonParseError); if (jsonParseError.error != QJsonParseError::NoError) { - qDebug() << "Error parsing QSettings file:" << jsonParseError.errorString(); + qCDebug(shared) << "Error parsing QSettings file:" << jsonParseError.errorString(); return false; } @@ -53,7 +54,7 @@ void loadOldINIFile(QSettings& settings) { QSettings iniSettings; if (!iniSettings.allKeys().isEmpty()) { - qDebug() << "No data in json settings file, trying to load old ini settings file."; + qCDebug(shared) << "No data in json settings file, trying to load old ini settings file."; for (auto key : iniSettings.allKeys()) { auto variant = iniSettings.value(key); @@ -75,7 +76,7 @@ void loadOldINIFile(QSettings& settings) { settings.setValue(key, variant); } - qDebug() << "Loaded" << settings.allKeys().size() << "keys from ini settings file."; + qCDebug(shared) << "Loaded" << settings.allKeys().size() << "keys from ini settings file."; } QSettings::setDefaultFormat(JSON_FORMAT); diff --git a/libraries/shared/src/SharedUtil.cpp b/libraries/shared/src/SharedUtil.cpp index 26483388e5..89116aa924 100644 --- a/libraries/shared/src/SharedUtil.cpp +++ b/libraries/shared/src/SharedUtil.cpp @@ -929,7 +929,7 @@ bool getProcessorInfo(ProcessorInfo& info) { GetModuleHandle(TEXT("kernel32")), "GetLogicalProcessorInformation"); if (nullptr == glpi) { - qDebug() << "GetLogicalProcessorInformation is not supported."; + qCDebug(shared) << "GetLogicalProcessorInformation is not supported."; return false; } @@ -946,11 +946,11 @@ bool getProcessorInfo(ProcessorInfo& info) { returnLength); if (NULL == buffer) { - qDebug() << "Error: Allocation failure"; + qCDebug(shared) << "Error: Allocation failure"; return false; } } else { - qDebug() << "Error " << GetLastError(); + qCDebug(shared) << "Error " << GetLastError(); return false; } } else { @@ -992,19 +992,19 @@ bool getProcessorInfo(ProcessorInfo& info) { break; default: - qDebug() << "\nError: Unsupported LOGICAL_PROCESSOR_RELATIONSHIP value.\n"; + qCDebug(shared) << "\nError: Unsupported LOGICAL_PROCESSOR_RELATIONSHIP value.\n"; break; } byteOffset += sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION); ptr++; } - qDebug() << "GetLogicalProcessorInformation results:"; - qDebug() << "Number of NUMA nodes:" << numaNodeCount; - qDebug() << "Number of physical processor packages:" << processorPackageCount; - qDebug() << "Number of processor cores:" << processorCoreCount; - qDebug() << "Number of logical processors:" << logicalProcessorCount; - qDebug() << "Number of processor L1/L2/L3 caches:" + qCDebug(shared) << "GetLogicalProcessorInformation results:"; + qCDebug(shared) << "Number of NUMA nodes:" << numaNodeCount; + qCDebug(shared) << "Number of physical processor packages:" << processorPackageCount; + qCDebug(shared) << "Number of processor cores:" << processorCoreCount; + qCDebug(shared) << "Number of logical processors:" << logicalProcessorCount; + qCDebug(shared) << "Number of processor L1/L2/L3 caches:" << processorL1CacheCount << "/" << processorL2CacheCount << "/" << processorL3CacheCount; diff --git a/libraries/shared/src/SpatiallyNestable.cpp b/libraries/shared/src/SpatiallyNestable.cpp index f75557f73f..cbe982b959 100644 --- a/libraries/shared/src/SpatiallyNestable.cpp +++ b/libraries/shared/src/SpatiallyNestable.cpp @@ -13,6 +13,7 @@ #include "DependencyManager.h" #include "SharedUtil.h" +#include "SharedLogging.h" #include "SpatiallyNestable.h" const float defaultAACubeSize = 1.0f; @@ -372,7 +373,7 @@ glm::vec3 SpatiallyNestable::getPosition() const { auto result = getPosition(success); #ifdef WANT_DEBUG if (!success) { - qDebug() << "Warning -- getPosition failed" << getID(); + qCDebug(shared) << "Warning -- getPosition failed" << getID(); } #endif return result; @@ -410,7 +411,7 @@ void SpatiallyNestable::setPosition(const glm::vec3& position) { setPosition(position, success); #ifdef WANT_DEBUG if (!success) { - qDebug() << "Warning -- setPosition failed" << getID(); + qCDebug(shared) << "Warning -- setPosition failed" << getID(); } #endif } @@ -424,7 +425,7 @@ glm::quat SpatiallyNestable::getOrientation() const { auto result = getOrientation(success); #ifdef WANT_DEBUG if (!success) { - qDebug() << "Warning -- getOrientation failed" << getID(); + qCDebug(shared) << "Warning -- getOrientation failed" << getID(); } #endif return result; @@ -462,7 +463,7 @@ void SpatiallyNestable::setOrientation(const glm::quat& orientation) { setOrientation(orientation, success); #ifdef WANT_DEBUG if (!success) { - qDebug() << "Warning -- setOrientation failed" << getID(); + qCDebug(shared) << "Warning -- setOrientation failed" << getID(); } #endif } @@ -488,7 +489,7 @@ glm::vec3 SpatiallyNestable::getVelocity() const { bool success; glm::vec3 result = getVelocity(success); if (!success) { - qDebug() << "Warning -- setVelocity failed" << getID(); + qCDebug(shared) << "Warning -- setVelocity failed" << getID(); } return result; } @@ -516,7 +517,7 @@ void SpatiallyNestable::setVelocity(const glm::vec3& velocity) { bool success; setVelocity(velocity, success); if (!success) { - qDebug() << "Warning -- setVelocity failed" << getID(); + qCDebug(shared) << "Warning -- setVelocity failed" << getID(); } } @@ -552,7 +553,7 @@ glm::vec3 SpatiallyNestable::getAngularVelocity() const { bool success; glm::vec3 result = getAngularVelocity(success); if (!success) { - qDebug() << "Warning -- getAngularVelocity failed" << getID(); + qCDebug(shared) << "Warning -- getAngularVelocity failed" << getID(); } return result; } @@ -569,7 +570,7 @@ void SpatiallyNestable::setAngularVelocity(const glm::vec3& angularVelocity) { bool success; setAngularVelocity(angularVelocity, success); if (!success) { - qDebug() << "Warning -- setAngularVelocity failed" << getID(); + qCDebug(shared) << "Warning -- setAngularVelocity failed" << getID(); } } @@ -599,7 +600,7 @@ const Transform SpatiallyNestable::getTransform() const { bool success; Transform result = getTransform(success); if (!success) { - qDebug() << "getTransform failed for" << getID(); + qCDebug(shared) << "getTransform failed for" << getID(); } return result; } @@ -612,7 +613,7 @@ const Transform SpatiallyNestable::getTransform(int jointIndex, bool& success, i if (depth > maxParentingChain) { success = false; // someone created a loop. break it... - qDebug() << "Parenting loop detected."; + qCDebug(shared) << "Parenting loop detected."; SpatiallyNestablePointer _this = getThisPointer(); _this->setParentID(QUuid()); bool setPositionSuccess; @@ -678,7 +679,7 @@ glm::vec3 SpatiallyNestable::getScale(int jointIndex) const { void SpatiallyNestable::setScale(const glm::vec3& scale) { // guard against introducing NaN into the transform if (isNaN(scale)) { - qDebug() << "SpatiallyNestable::setScale -- scale contains NaN"; + qCDebug(shared) << "SpatiallyNestable::setScale -- scale contains NaN"; return; } @@ -698,7 +699,7 @@ void SpatiallyNestable::setScale(const glm::vec3& scale) { void SpatiallyNestable::setScale(float value) { // guard against introducing NaN into the transform if (value <= 0.0f) { - qDebug() << "SpatiallyNestable::setScale -- scale is zero or negative value"; + qCDebug(shared) << "SpatiallyNestable::setScale -- scale is zero or negative value"; return; } @@ -728,7 +729,7 @@ const Transform SpatiallyNestable::getLocalTransform() const { void SpatiallyNestable::setLocalTransform(const Transform& transform) { // guard against introducing NaN into the transform if (transform.containsNaN()) { - qDebug() << "SpatiallyNestable::setLocalTransform -- transform contains NaN"; + qCDebug(shared) << "SpatiallyNestable::setLocalTransform -- transform contains NaN"; return; } @@ -756,7 +757,7 @@ glm::vec3 SpatiallyNestable::getLocalPosition() const { void SpatiallyNestable::setLocalPosition(const glm::vec3& position, bool tellPhysics) { // guard against introducing NaN into the transform if (isNaN(position)) { - qDebug() << "SpatiallyNestable::setLocalPosition -- position contains NaN"; + qCDebug(shared) << "SpatiallyNestable::setLocalPosition -- position contains NaN"; return; } bool changed = false; @@ -782,7 +783,7 @@ glm::quat SpatiallyNestable::getLocalOrientation() const { void SpatiallyNestable::setLocalOrientation(const glm::quat& orientation) { // guard against introducing NaN into the transform if (isNaN(orientation)) { - qDebug() << "SpatiallyNestable::setLocalOrientation -- orientation contains NaN"; + qCDebug(shared) << "SpatiallyNestable::setLocalOrientation -- orientation contains NaN"; return; } bool changed = false; @@ -837,7 +838,7 @@ glm::vec3 SpatiallyNestable::getLocalScale() const { void SpatiallyNestable::setLocalScale(const glm::vec3& scale) { // guard against introducing NaN into the transform if (isNaN(scale)) { - qDebug() << "SpatiallyNestable::setLocalScale -- scale contains NaN"; + qCDebug(shared) << "SpatiallyNestable::setLocalScale -- scale contains NaN"; return; } @@ -935,7 +936,7 @@ void SpatiallyNestable::checkAndAdjustQueryAACube() { void SpatiallyNestable::setQueryAACube(const AACube& queryAACube) { if (queryAACube.containsNaN()) { - qDebug() << "SpatiallyNestable::setQueryAACube -- cube contains NaN"; + qCDebug(shared) << "SpatiallyNestable::setQueryAACube -- cube contains NaN"; return; } _queryAACube = queryAACube; @@ -948,7 +949,7 @@ bool SpatiallyNestable::queryAABoxNeedsUpdate() const { bool success; AACube currentAACube = getMaximumAACube(success); if (!success) { - qDebug() << "can't getMaximumAACube for" << getID(); + qCDebug(shared) << "can't getMaximumAACube for" << getID(); return false; } @@ -1009,7 +1010,7 @@ AACube SpatiallyNestable::getQueryAACube() const { bool success; auto result = getQueryAACube(success); if (!success) { - qDebug() << "getQueryAACube failed for" << getID(); + qCDebug(shared) << "getQueryAACube failed for" << getID(); } return result; } diff --git a/libraries/shared/src/shared/FileLogger.cpp b/libraries/shared/src/shared/FileLogger.cpp index 3f181b36d5..bea28b2b6f 100644 --- a/libraries/shared/src/shared/FileLogger.cpp +++ b/libraries/shared/src/shared/FileLogger.cpp @@ -20,6 +20,7 @@ #include "../NumericalConstants.h" #include "../SharedUtil.h" +#include "../SharedLogging.h" class FilePersistThread : public GenericQueueThread < QString > { Q_OBJECT @@ -88,7 +89,7 @@ void FilePersistThread::rollFileIfNecessary(QFile& file, bool notifyListenersIfR if (file.copy(newFileName)) { file.open(QIODevice::WriteOnly | QIODevice::Truncate); file.close(); - qDebug() << "Rolled log file:" << newFileName; + qCDebug(shared) << "Rolled log file:" << newFileName; if (notifyListenersIfRolled) { emit rollingLogFile(newFileName); diff --git a/libraries/ui/src/FileDialogHelper.cpp b/libraries/ui/src/FileDialogHelper.cpp index 9d791ec562..2752de8592 100644 --- a/libraries/ui/src/FileDialogHelper.cpp +++ b/libraries/ui/src/FileDialogHelper.cpp @@ -9,6 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "FileDialogHelper.h" +#include "ui/Logging.h" #include #include @@ -47,7 +48,7 @@ QUrl FileDialogHelper::pathToUrl(const QString& path) { QUrl FileDialogHelper::saveHelper(const QString& saveText, const QUrl& currentFolder, const QStringList& selectionFilters) { - qDebug() << "Calling save helper with " << saveText << " " << currentFolder << " " << selectionFilters; + qDebug(uiLogging) << "Calling save helper with " << saveText << " " << currentFolder << " " << selectionFilters; QFileInfo fileInfo(saveText); diff --git a/libraries/ui/src/MainWindow.cpp b/libraries/ui/src/MainWindow.cpp index 545d2dc902..c3ad59bf48 100644 --- a/libraries/ui/src/MainWindow.cpp +++ b/libraries/ui/src/MainWindow.cpp @@ -24,6 +24,7 @@ #include #include +#include "ui/Logging.h" MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), @@ -35,7 +36,7 @@ MainWindow::MainWindow(QWidget* parent) : } MainWindow::~MainWindow() { - qDebug() << "Destroying main window"; + qCDebug(uiLogging) << "Destroying main window"; } void MainWindow::restoreGeometry() { diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index d9b15eebe0..60d80c6b35 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -23,6 +23,8 @@ #include "FileDialogHelper.h" #include "VrMenu.h" +#include "ui/Logging.h" + // Needs to match the constants in resources/qml/Global.js class OffscreenFlags : public QObject { @@ -73,7 +75,6 @@ bool OffscreenUi::shouldSwallowShortcut(QEvent* event) { Q_ASSERT(event->type() == QEvent::ShortcutOverride); QObject* focusObject = getWindow()->focusObject(); if (focusObject != getWindow() && focusObject != getRootItem()) { - //qDebug() << "Swallowed shortcut " << static_cast(event)->key(); event->accept(); return true; } @@ -493,7 +494,7 @@ private: void OffscreenUi::createDesktop(const QUrl& url) { if (_desktop) { - qDebug() << "Desktop already created"; + qCDebug(uiLogging) << "Desktop already created"; return; } @@ -573,7 +574,7 @@ QString OffscreenUi::fileDialog(const QVariantMap& properties) { if (!result.isValid()) { return QString(); } - qDebug() << result.toString(); + qCDebug(uiLogging) << result.toString(); return result.toUrl().toLocalFile(); } diff --git a/libraries/ui/src/VrMenu.cpp b/libraries/ui/src/VrMenu.cpp index 552d082aaa..73eb32ce17 100644 --- a/libraries/ui/src/VrMenu.cpp +++ b/libraries/ui/src/VrMenu.cpp @@ -15,6 +15,7 @@ #include #include "OffscreenUi.h" +#include "ui/Logging.h" static unsigned int USER_DATA_ID = 0; @@ -158,7 +159,7 @@ void VrMenu::addMenu(QMenu* menu) { void bindActionToQmlAction(QObject* qmlAction, QAction* action) { auto text = action->text(); if (text == "Login") { - qDebug() << "Login action " << action; + qDebug(uiLogging) << "Login action " << action; } new MenuUserData(action, qmlAction); diff --git a/plugins/hifiKinect/src/KinectPlugin.cpp b/plugins/hifiKinect/src/KinectPlugin.cpp index 844d4af962..2c837d83d3 100644 --- a/plugins/hifiKinect/src/KinectPlugin.cpp +++ b/plugins/hifiKinect/src/KinectPlugin.cpp @@ -286,12 +286,9 @@ bool KinectPlugin::initializeDefaultSensor() { } if (!_kinectSensor || FAILED(hr)) { - qDebug() << "No ready Kinect found!"; return false; } - qDebug() << "Kinect found WOOT!"; - return true; #else return false;