Commit 5e4dd02f1c00eb9e4b281eed1b45b152700eb248

Authored by Moritz Wirger
1 parent 8a0c7fe4

Print error messages to std::cerr rather than std::cout in Hue.cpp

Showing 1 changed file with 2 additions and 2 deletions
hueplusplus/Hue.cpp
@@ -180,7 +180,7 @@ HueLight& Hue::getLight(int id) @@ -180,7 +180,7 @@ HueLight& Hue::getLight(int id)
180 refreshState(); 180 refreshState();
181 if (!state["lights"].isMember(std::to_string(id))) 181 if (!state["lights"].isMember(std::to_string(id)))
182 { 182 {
183 - std::cout << "Error in Hue getLight(): light with id " << id << " is not valid\n"; 183 + std::cerr << "Error in Hue getLight(): light with id " << id << " is not valid\n";
184 throw(std::runtime_error("Error in Hue getLight(): light id is not valid")); 184 throw(std::runtime_error("Error in Hue getLight(): light id is not valid"));
185 } 185 }
186 //std::cout << state["lights"][std::to_string(id)] << std::endl; 186 //std::cout << state["lights"][std::to_string(id)] << std::endl;
@@ -226,7 +226,7 @@ HueLight&amp; Hue::getLight(int id) @@ -226,7 +226,7 @@ HueLight&amp; Hue::getLight(int id)
226 lights.emplace(id, light); 226 lights.emplace(id, light);
227 return lights.find(id)->second; 227 return lights.find(id)->second;
228 } 228 }
229 - std::cout << "Could not determine HueLight type!\n"; 229 + std::cerr << "Could not determine HueLight type!\n";
230 throw(std::runtime_error("Could not determine HueLight type!")); 230 throw(std::runtime_error("Could not determine HueLight type!"));
231 } 231 }
232 232