Working C++ IoTSlave for both IoTSet and IoTRelation; threading works for C++ LifxLig...
[iot2.git] / benchmarks / Cpp / Lifxtest / RoomSmart_Stub.hpp
index b576cfcd0e8b9e31782109409c9622d34c8ab475..8c0f3cfd32595702d39e75d37a68a11676463f5f 100644 (file)
@@ -25,7 +25,13 @@ class RoomSmart_Stub : public RoomSmart
                callbackAddress = _callbackAddress;
                ports = _ports;
                // Logging
-               log.open("RoomSmart_Stub_cpp.log");
+               int i=0;
+               string file = "RoomSmart_Stub_cpp" + to_string(i) + ".log";
+               while (ifstream(file.c_str())) {
+                       i++;
+                       file = "RoomSmart_Stub_cpp" + to_string(i) + ".log";
+               }
+               log.open(file);
                log << "Port: " << _port << endl;
                log << "Skeleton address: " << _skeletonAddress << endl;
                log << "Callback address: " << callbackAddress << endl;