summaryrefslogtreecommitdiffstats
path: root/common/listener.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-20 18:20:38 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-20 18:21:04 +0200
commit22eee9e798f00f9e58d1dc0f1b893abee2582ba2 (patch)
treea5873370e128a2d03384d5b7ebc2d175fd6dd49a /common/listener.cpp
parent315524e15da36da523ccbf701c061fbb5a5d34ec (diff)
downloadsink-22eee9e798f00f9e58d1dc0f1b893abee2582ba2.tar.gz
sink-22eee9e798f00f9e58d1dc0f1b893abee2582ba2.zip
Made the log-level output a lot less noisy
Diffstat (limited to 'common/listener.cpp')
-rw-r--r--common/listener.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/common/listener.cpp b/common/listener.cpp
index 6cbf40f..cb974cf 100644
--- a/common/listener.cpp
+++ b/common/listener.cpp
@@ -120,7 +120,7 @@ void Listener::closeAllConnections()
120 120
121void Listener::acceptConnection() 121void Listener::acceptConnection()
122{ 122{
123 Log() << "Accepting connection"; 123 Trace() << "Accepting connection";
124 QLocalSocket *socket = m_server->nextPendingConnection(); 124 QLocalSocket *socket = m_server->nextPendingConnection();
125 125
126 if (!socket) { 126 if (!socket) {
@@ -239,7 +239,7 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c
239 flatbuffers::Verifier verifier((const uint8_t *)commandBuffer.constData(), commandBuffer.size()); 239 flatbuffers::Verifier verifier((const uint8_t *)commandBuffer.constData(), commandBuffer.size());
240 if (Sink::Commands::VerifySynchronizeBuffer(verifier)) { 240 if (Sink::Commands::VerifySynchronizeBuffer(verifier)) {
241 auto buffer = Sink::Commands::GetSynchronize(commandBuffer.constData()); 241 auto buffer = Sink::Commands::GetSynchronize(commandBuffer.constData());
242 Log() << QString("\tSynchronize request (id %1) from %2").arg(messageId).arg(client.name); 242 Trace() << QString("Synchronize request (id %1) from %2").arg(messageId).arg(client.name);
243 auto timer = QSharedPointer<QTime>::create(); 243 auto timer = QSharedPointer<QTime>::create();
244 timer->start(); 244 timer->start();
245 auto job = KAsync::null<void>(); 245 auto job = KAsync::null<void>();
@@ -268,20 +268,20 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c
268 case Sink::Commands::DeleteEntityCommand: 268 case Sink::Commands::DeleteEntityCommand:
269 case Sink::Commands::ModifyEntityCommand: 269 case Sink::Commands::ModifyEntityCommand:
270 case Sink::Commands::CreateEntityCommand: 270 case Sink::Commands::CreateEntityCommand:
271 Log() << "\tCommand id " << messageId << " of type \"" << Sink::Commands::name(commandId) << "\" from " << client.name; 271 Trace() << "Command id " << messageId << " of type \"" << Sink::Commands::name(commandId) << "\" from " << client.name;
272 loadResource()->processCommand(commandId, commandBuffer); 272 loadResource()->processCommand(commandId, commandBuffer);
273 break; 273 break;
274 case Sink::Commands::ShutdownCommand: 274 case Sink::Commands::ShutdownCommand:
275 Log() << QString("\tReceived shutdown command from %1").arg(client.name); 275 Log() << QString("Received shutdown command from %1").arg(client.name);
276 // Immediately reject new connections 276 // Immediately reject new connections
277 m_server->close(); 277 m_server->close();
278 QTimer::singleShot(0, this, &Listener::quit); 278 QTimer::singleShot(0, this, &Listener::quit);
279 break; 279 break;
280 case Sink::Commands::PingCommand: 280 case Sink::Commands::PingCommand:
281 Log() << QString("\tReceived ping command from %1").arg(client.name); 281 Trace() << QString("Received ping command from %1").arg(client.name);
282 break; 282 break;
283 case Sink::Commands::RevisionReplayedCommand: { 283 case Sink::Commands::RevisionReplayedCommand: {
284 Log() << QString("\tReceived revision replayed command from %1").arg(client.name); 284 Trace() << QString("Received revision replayed command from %1").arg(client.name);
285 flatbuffers::Verifier verifier((const uint8_t *)commandBuffer.constData(), commandBuffer.size()); 285 flatbuffers::Verifier verifier((const uint8_t *)commandBuffer.constData(), commandBuffer.size());
286 if (Sink::Commands::VerifyRevisionReplayedBuffer(verifier)) { 286 if (Sink::Commands::VerifyRevisionReplayedBuffer(verifier)) {
287 auto buffer = Sink::Commands::GetRevisionReplayed(commandBuffer.constData()); 287 auto buffer = Sink::Commands::GetRevisionReplayed(commandBuffer.constData());
@@ -292,7 +292,7 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c
292 loadResource()->setLowerBoundRevision(lowerBoundRevision()); 292 loadResource()->setLowerBoundRevision(lowerBoundRevision());
293 } break; 293 } break;
294 case Sink::Commands::RemoveFromDiskCommand: { 294 case Sink::Commands::RemoveFromDiskCommand: {
295 Log() << QString("\tReceived a remove from disk command from %1").arg(client.name); 295 Log() << QString("Received a remove from disk command from %1").arg(client.name);
296 m_resource->removeDataFromDisk(); 296 m_resource->removeDataFromDisk();
297 delete m_resource; 297 delete m_resource;
298 m_resource = nullptr; 298 m_resource = nullptr;
@@ -300,7 +300,7 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c
300 } break; 300 } break;
301 default: 301 default:
302 if (commandId > Sink::Commands::CustomCommand) { 302 if (commandId > Sink::Commands::CustomCommand) {
303 Log() << QString("\tReceived custom command from %1: ").arg(client.name) << commandId; 303 Log() << QString("Received custom command from %1: ").arg(client.name) << commandId;
304 loadResource()->processCommand(commandId, commandBuffer); 304 loadResource()->processCommand(commandId, commandBuffer);
305 } else { 305 } else {
306 success = false; 306 success = false;
@@ -365,7 +365,7 @@ bool Listener::processClientBuffer(Client &client)
365 const QByteArray commandBuffer = client.commandBuffer.left(size); 365 const QByteArray commandBuffer = client.commandBuffer.left(size);
366 client.commandBuffer.remove(0, size); 366 client.commandBuffer.remove(0, size);
367 processCommand(commandId, messageId, commandBuffer, client, [this, messageId, commandId, socket, clientName](bool success) { 367 processCommand(commandId, messageId, commandBuffer, client, [this, messageId, commandId, socket, clientName](bool success) {
368 Log() << QString("\tCompleted command messageid %1 of type \"%2\" from %3").arg(messageId).arg(QString(Sink::Commands::name(commandId))).arg(clientName); 368 Trace() << QString("Completed command messageid %1 of type \"%2\" from %3").arg(messageId).arg(QString(Sink::Commands::name(commandId))).arg(clientName);
369 if (socket) { 369 if (socket) {
370 sendCommandCompleted(socket.data(), messageId, success); 370 sendCommandCompleted(socket.data(), messageId, success);
371 } else { 371 } else {