mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Rework log messages
Former-commit-id: eac93c0fd78fdf353e940d08df3cabf0b962a3e2
This commit is contained in:
@@ -164,7 +164,7 @@ void JsonClientConnection::handleWebSocketFrame()
|
||||
}
|
||||
} else
|
||||
{
|
||||
std::cout << "Someone is sending very big messages over several frames... it's not supported yet" << std::endl;
|
||||
std::cout << "JSONCLIENT INFO: Someone is sending very big messages over several frames... it's not supported yet" << std::endl;
|
||||
quint8 close[] = {0x88, 0};
|
||||
_socket->write((const char*)close, 2);
|
||||
_socket->flush();
|
||||
@@ -400,7 +400,7 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &)
|
||||
const ColorCorrection * colorCorrection = _hyperion->getCorrection(correctionId);
|
||||
if (colorCorrection == nullptr)
|
||||
{
|
||||
std::cerr << "Incorrect color correction id: " << correctionId << std::endl;
|
||||
std::cerr << "JSONCLIENT ERROR: Incorrect color correction id: " << correctionId << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &)
|
||||
const ColorCorrection * colorTemp = _hyperion->getTemperature(tempId);
|
||||
if (colorTemp == nullptr)
|
||||
{
|
||||
std::cerr << "Incorrect color temperature correction id: " << tempId << std::endl;
|
||||
std::cerr << "JSONCLIENT ERROR: Incorrect color temperature correction id: " << tempId << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &)
|
||||
const ColorTransform * colorTransform = _hyperion->getTransform(transformId);
|
||||
if (colorTransform == nullptr)
|
||||
{
|
||||
std::cerr << "Incorrect color transform id: " << transformId << std::endl;
|
||||
std::cerr << "JSONCLIENT ERROR: Incorrect color transform id: " << transformId << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -743,7 +743,7 @@ bool JsonClientConnection::checkJson(const Json::Value & message, const QString
|
||||
Json::Value schemaJson;
|
||||
if (!jsonReader.parse(reinterpret_cast<const char *>(schemaData.data()), reinterpret_cast<const char *>(schemaData.data()) + schemaData.size(), schemaJson, false))
|
||||
{
|
||||
throw std::runtime_error("Schema error: " + jsonReader.getFormattedErrorMessages()) ;
|
||||
throw std::runtime_error("JSONCLIENT ERROR: Schema error: " + jsonReader.getFormattedErrorMessages()) ;
|
||||
}
|
||||
|
||||
// create schema checker
|
||||
|
@@ -13,14 +13,14 @@ JsonServer::JsonServer(Hyperion *hyperion, uint16_t port) :
|
||||
{
|
||||
if (!_server.listen(QHostAddress::Any, port))
|
||||
{
|
||||
throw std::runtime_error("Json server could not bind to port");
|
||||
throw std::runtime_error("JSONSERVER ERROR: could not bind to port");
|
||||
}
|
||||
|
||||
QList<MessageForwarder::JsonSlaveAddress> list = _hyperion->getForwarder()->getJsonSlaves();
|
||||
for ( int i=0; i<list.size(); i++ )
|
||||
{
|
||||
if ( list.at(i).addr == QHostAddress::LocalHost && list.at(i).port == port ) {
|
||||
throw std::runtime_error("Loop between proto server and forwarder detected. Fix your config!");
|
||||
throw std::runtime_error("JSONSERVER ERROR: Loop between proto server and forwarder detected. Fix your config!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void JsonServer::newConnection()
|
||||
|
||||
if (socket != nullptr)
|
||||
{
|
||||
std::cout << "New json connection" << std::endl;
|
||||
std::cout << "JSONSERVER INFO: New connection" << std::endl;
|
||||
JsonClientConnection * connection = new JsonClientConnection(socket, _hyperion);
|
||||
_openConnections.insert(connection);
|
||||
|
||||
@@ -60,7 +60,7 @@ void JsonServer::newConnection()
|
||||
|
||||
void JsonServer::closedConnection(JsonClientConnection *connection)
|
||||
{
|
||||
std::cout << "Json connection closed" << std::endl;
|
||||
std::cout << "JSONSERVER INFO: Connection closed" << std::endl;
|
||||
_openConnections.remove(connection);
|
||||
|
||||
// schedule to delete the connection object
|
||||
|
Reference in New Issue
Block a user