add debug output to test devices

This commit is contained in:
Alexey Rybalchenko 2017-04-11 16:44:45 +02:00 committed by Mohammad Al-Turany
parent 218af15bbb
commit ee0d2e0c55
2 changed files with 12 additions and 2 deletions

View File

@ -34,7 +34,11 @@ class Pub : public FairMQDevice
auto msg = FairMQMessagePtr{NewMessage()}; auto msg = FairMQMessagePtr{NewMessage()};
auto d1 = Send(msg, "data"); auto d1 = Send(msg, "data");
if (d1 < 0) if (d1 >= 0)
{
LOG(INFO) << "Sent data: d1 = " << d1;
}
else
{ {
LOG(ERROR) << "Failed sending data: d1 = " << d1; LOG(ERROR) << "Failed sending data: d1 = " << d1;
} }

View File

@ -28,13 +28,19 @@ class Sub : public FairMQDevice
auto r1 = Send(ready, "control"); auto r1 = Send(ready, "control");
if (r1 >= 0) if (r1 >= 0)
{ {
LOG(INFO) << "Sent first control signal";
auto msg = FairMQMessagePtr{NewMessage()}; auto msg = FairMQMessagePtr{NewMessage()};
auto d1 = Receive(msg, "data"); auto d1 = Receive(msg, "data");
if (d1 >= 0) if (d1 >= 0)
{ {
LOG(INFO) << "Received data";
auto ack = FairMQMessagePtr{NewMessage()}; auto ack = FairMQMessagePtr{NewMessage()};
auto a1 = Send(ack, "control"); auto a1 = Send(ack, "control");
if (a1 < 0) if (a1 >= 0)
{
LOG(INFO) << "Sent second control signal";
}
else
{ {
LOG(ERROR) << "Failed sending ack signal: a1 = " << a1; LOG(ERROR) << "Failed sending ack signal: a1 = " << a1;
} }