remove newline from logging statements. (#5022)

remove newline from logging statements in code. The LOG_* functions will now magically add it at the end.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Thomas Göttgens
2024-10-14 06:11:43 +02:00
committed by GitHub
parent fb9f361052
commit 05e4a639a1
150 changed files with 1816 additions and 1800 deletions

View File

@@ -26,7 +26,7 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp,
msgType = "text";
// convert bytes to string
if (shouldLog)
LOG_DEBUG("got text message of size %u\n", mp->decoded.payload.size);
LOG_DEBUG("got text message of size %u", mp->decoded.payload.size);
char payloadStr[(mp->decoded.payload.size) + 1];
memcpy(payloadStr, mp->decoded.payload.bytes, mp->decoded.payload.size);
@@ -35,7 +35,7 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp,
JSONValue *json_value = JSON::Parse(payloadStr);
if (json_value != NULL) {
if (shouldLog)
LOG_INFO("text message payload is of type json\n");
LOG_INFO("text message payload is of type json");
// if it is, then we can just use the json object
jsonObj["payload"] = json_value;
@@ -43,7 +43,7 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp,
// if it isn't, then we need to create a json object
// with the string as the value
if (shouldLog)
LOG_INFO("text message payload is of type plaintext\n");
LOG_INFO("text message payload is of type plaintext");
msgPayload["text"] = new JSONValue(payloadStr);
jsonObj["payload"] = new JSONValue(msgPayload);
@@ -294,7 +294,7 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp,
break;
}
} else if (shouldLog) {
LOG_WARN("Couldn't convert encrypted payload of MeshPacket to JSON\n");
LOG_WARN("Couldn't convert encrypted payload of MeshPacket to JSON");
}
jsonObj["id"] = new JSONValue((unsigned int)mp->id);
@@ -318,7 +318,7 @@ std::string MeshPacketSerializer::JsonSerialize(const meshtastic_MeshPacket *mp,
std::string jsonStr = value->Stringify();
if (shouldLog)
LOG_INFO("serialized json message: %s\n", jsonStr.c_str());
LOG_INFO("serialized json message: %s", jsonStr.c_str());
delete value;
return jsonStr;