make edit logging terse vs not a domain-server setting

This commit is contained in:
Seth Alves 2015-10-14 09:45:35 -07:00
parent 77bb11675d
commit 9a9e5b962e
4 changed files with 25 additions and 6 deletions
assignment-client/src/entities
domain-server/resources
libraries/entities/src

View file

@ -147,9 +147,13 @@ bool EntityServer::readAdditionalConfiguration(const QJsonObject& settingsSectio
readOptionBool(QString("wantEditLogging"), settingsSectionObject, wantEditLogging);
qDebug("wantEditLogging=%s", debug::valueOf(wantEditLogging));
bool wantTerseEditLogging = false;
readOptionBool(QString("wantTerseEditLogging"), settingsSectionObject, wantTerseEditLogging);
qDebug("wantTerseEditLogging=%s", debug::valueOf(wantTerseEditLogging));
EntityTreePointer tree = std::static_pointer_cast<EntityTree>(_tree);
tree->setWantEditLogging(wantEditLogging);
tree->setWantTerseEditLogging(wantTerseEditLogging);
return true;
}

View file

@ -484,6 +484,14 @@
"default": false,
"advanced": true
},
{
"name": "wantTerseEditLogging",
"type": "checkbox",
"label": "Edit Logging (Terse)",
"help": "Logging of all edits to entities",
"default": false,
"advanced": true
},
{
"name": "verboseDebug",
"type": "checkbox",

View file

@ -610,10 +610,10 @@ int EntityTree::processEditPacketData(NLPacket& packet, const unsigned char* edi
// if the EntityItem exists, then update it
startLogging = usecTimestampNow();
if (wantEditLogging()) {
// qCDebug(entities) << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID;
// qCDebug(entities) << " properties:" << properties;
qCDebug(entities) << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID;
qCDebug(entities) << " properties:" << properties;
}
if (wantTerseEditLogging()) {
qCDebug(entities) << "edit" << entityItemID.toString() << properties.listChangedProperties();
}
endLogging = usecTimestampNow();
@ -641,6 +641,9 @@ int EntityTree::processEditPacketData(NLPacket& packet, const unsigned char* edi
<< newEntity->getEntityItemID();
qCDebug(entities) << " properties:" << properties;
}
if (wantTerseEditLogging()) {
qCDebug(entities) << "add" << entityItemID.toString() << properties.listChangedProperties();
}
endLogging = usecTimestampNow();
}
@ -872,7 +875,7 @@ int EntityTree::processEraseMessage(NLPacket& packet, const SharedNodePointer& s
EntityItemID entityItemID(entityID);
entityItemIDsToDelete << entityItemID;
if (wantEditLogging()) {
if (wantEditLogging() || wantTerseEditLogging()) {
qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
}
@ -916,7 +919,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
EntityItemID entityItemID(entityID);
entityItemIDsToDelete << entityItemID;
if (wantEditLogging()) {
if (wantEditLogging() || wantTerseEditLogging()) {
qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
}

View file

@ -175,6 +175,9 @@ public:
bool wantEditLogging() const { return _wantEditLogging; }
void setWantEditLogging(bool value) { _wantEditLogging = value; }
bool wantTerseEditLogging() const { return _wantTerseEditLogging; }
void setWantTerseEditLogging(bool value) { _wantTerseEditLogging = value; }
bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues);
bool readFromMap(QVariantMap& entityDescription);
@ -240,6 +243,7 @@ private:
EntitySimulation* _simulation;
bool _wantEditLogging = false;
bool _wantTerseEditLogging = false;
void maybeNotifyNewCollisionSoundURL(const QString& oldCollisionSoundURL, const QString& newCollisionSoundURL);