Merge pull request #7655 from sethalves/dont-spam-about-expired-actions

don't flood log with messages about expired actions
This commit is contained in:
Brad Hefta-Gaub 2016-04-14 09:32:56 -07:00
commit 285ebe8ec5
2 changed files with 18 additions and 9 deletions

View file

@ -14,6 +14,7 @@
#include <avatar/AvatarActionHold.h>
#include <ObjectActionOffset.h>
#include <ObjectActionSpring.h>
#include <LogHandler.h>
#include "InterfaceActionFactory.h"
@ -66,6 +67,8 @@ EntityActionPointer InterfaceActionFactory::factoryBA(EntityItemPointer ownerEnt
if (action) {
action->deserialize(data);
if (action->lifetimeIsOver()) {
static QString repeatedMessage =
LogHandler::getInstance().addRepeatedMessageRegex(".*factoryBA lifetimeIsOver during action creation.*");
qDebug() << "InterfaceActionFactory::factoryBA lifetimeIsOver during action creation --"
<< action->getExpires() << "<" << usecTimestampNow();
return nullptr;

View file

@ -24,6 +24,7 @@
#include <RegisteredMetaTypes.h>
#include <SharedUtil.h> // usecTimestampNow()
#include <SoundCache.h>
#include <LogHandler.h>
#include "EntityScriptingInterface.h"
#include "EntitiesLogging.h"
@ -516,8 +517,8 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
EntityTreePointer tree = getTree();
if (tree && tree->isDeletedEntity(_id)) {
#ifdef WANT_DEBUG
qDebug() << "Received packet for previously deleted entity [" << _id << "] ignoring. "
"(inside " << __FUNCTION__ << ")";
qCDebug(entities) << "Received packet for previously deleted entity [" << _id << "] ignoring. "
"(inside " << __FUNCTION__ << ")";
#endif
ignoreServerPacket = true;
}
@ -1685,7 +1686,7 @@ bool EntityItem::addActionInternal(EntitySimulation* simulation, EntityActionPoi
_allActionsDataCache = newDataCache;
_dirtyFlags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
} else {
qDebug() << "EntityItem::addActionInternal -- serializeActions failed";
qCDebug(entities) << "EntityItem::addActionInternal -- serializeActions failed";
}
return success;
}
@ -1706,7 +1707,7 @@ bool EntityItem::updateAction(EntitySimulation* simulation, const QUuid& actionI
serializeActions(success, _allActionsDataCache);
_dirtyFlags |= Simulation::DIRTY_PHYSICS_ACTIVATION;
} else {
qDebug() << "EntityItem::updateAction failed";
qCDebug(entities) << "EntityItem::updateAction failed";
}
});
return success;
@ -1777,7 +1778,7 @@ void EntityItem::deserializeActionsInternal() {
quint64 now = usecTimestampNow();
if (!_element) {
qDebug() << "EntityItem::deserializeActionsInternal -- no _element";
qCDebug(entities) << "EntityItem::deserializeActionsInternal -- no _element";
return;
}
@ -1805,14 +1806,13 @@ void EntityItem::deserializeActionsInternal() {
continue;
}
updated << actionID;
if (_objectActions.contains(actionID)) {
EntityActionPointer action = _objectActions[actionID];
// TODO: make sure types match? there isn't currently a way to
// change the type of an existing action.
action->deserialize(serializedAction);
action->locallyAddedButNotYetReceived = false;
updated << actionID;
} else {
auto actionFactory = DependencyManager::get<EntityActionFactoryInterface>();
EntityItemPointer entity = getThisPointer();
@ -1820,8 +1820,13 @@ void EntityItem::deserializeActionsInternal() {
if (action) {
entity->addActionInternal(simulation, action);
action->locallyAddedButNotYetReceived = false;
updated << actionID;
} else {
qDebug() << "EntityItem::deserializeActionsInternal -- action creation failed";
static QString repeatedMessage =
LogHandler::getInstance().addRepeatedMessageRegex(".*action creation failed for.*");
qCDebug(entities) << "EntityItem::deserializeActionsInternal -- action creation failed for"
<< getID() << getName();
removeActionInternal(actionID, nullptr);
}
}
}
@ -1897,7 +1902,8 @@ void EntityItem::serializeActions(bool& success, QByteArray& result) const {
serializedActionsStream << serializedActions;
if (result.size() >= _maxActionsDataSize) {
qDebug() << "EntityItem::serializeActions size is too large -- " << result.size() << ">=" << _maxActionsDataSize;
qCDebug(entities) << "EntityItem::serializeActions size is too large -- "
<< result.size() << ">=" << _maxActionsDataSize;
success = false;
return;
}