Skip to content

Commit 42715c0

Browse files
committed
Fix log formatting
1 parent 6480cad commit 42715c0

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/CaptivePortalInstance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void CaptivePortalInstance::handleWebSocketEvent(uint8_t socketId, WebSocketMess
198198
break;
199199
default:
200200
m_socketDeFragger.clear();
201-
OS_LOGE(TAG, "Unknown WebSocket event type: %u", type);
201+
OS_LOGE(TAG, "Unknown WebSocket event type: %hhu", static_cast<uint8_t>(type));
202202
break;
203203
}
204204
}

src/GatewayConnectionManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ bool FetchHubInfo(std::string authToken)
202202
OS_LOGI(TAG, "Hub Name: %s", response.data.hubName.c_str());
203203
OS_LOGI(TAG, "Shockers:");
204204
for (auto& shocker : response.data.shockers) {
205-
OS_LOGI(TAG, " [%s] rf=%u model=%u", shocker.id.c_str(), shocker.rfId, shocker.model);
205+
OS_LOGI(TAG, " [%s] rf=%hu model=%hhu", shocker.id.c_str(), shocker.rfId, static_cast<uint8_t>(shocker.model));
206206
}
207207

208208
s_flags |= FLAG_LINKED;

src/OtaUpdateManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,11 +537,11 @@ bool OtaUpdateManager::TryGetFirmwareVersion(OtaUpdateChannel channel, OpenShock
537537
channelIndexUrl = OPENSHOCK_FW_CDN_DEVELOP_URL ""sv;
538538
break;
539539
default:
540-
OS_LOGE(TAG, "Unknown channel: %u", channel);
540+
OS_LOGE(TAG, "Unknown channel: %hhu", static_cast<uint8_t>(channel));
541541
return false;
542542
}
543543

544-
OS_LOGD(TAG, "Fetching firmware version from %s", channelIndexUrl);
544+
OS_LOGD(TAG, "Fetching firmware version from %s", channelIndexUrl.data());
545545

546546
auto response = OpenShock::HTTP::GetString(
547547
channelIndexUrl,

src/message_handlers/websocket/gateway/_InvalidMessage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ void _Private::HandleInvalidMessage(const OpenShock::Serialization::Gateway::Gat
1313
return;
1414
}
1515

16-
OS_LOGE(TAG, "Invalid message type: %u", root->payload_type());
16+
OS_LOGE(TAG, "Invalid message type: %hhu", static_cast<uint8_t>(root->payload_type()));
1717
}

src/message_handlers/websocket/local/_InvalidMessage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ void _Private::HandleInvalidMessage(uint8_t socketId, const OpenShock::Serializa
1515
return;
1616
}
1717

18-
OS_LOGE(TAG, "Invalid message type: %d", root->payload_type());
18+
OS_LOGE(TAG, "Invalid message type: %hhu", static_cast<uint8_t>(root->payload_type()));
1919
}

src/radio/RFTransmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool RFTransmitter::SendCommand(ShockerModelType model, uint16_t shockerId, Shoc
8989
durationMs = 300;
9090
overwriteExisting = true;
9191
} else {
92-
OS_LOGD(TAG, "Command received: %u %u %u %u", model, shockerId, type, intensity);
92+
OS_LOGD(TAG, "Command received: %hhu %hu %hhu %hhu", static_cast<uint8_t>(model), shockerId, static_cast<uint8_t>(type), intensity);
9393
}
9494

9595
Command cmd = Command {.transmitEnd = OpenShock::millis() + durationMs, .modelType = model, .type = type, .shockerId = shockerId, .intensity = intensity, .flags = overwriteExisting ? kFlagOverwrite : (uint8_t)0};
@@ -222,7 +222,7 @@ void RFTransmitter::TransmitTask()
222222
}
223223

224224
if (!addSequence(sequences, cmd.modelType, cmd.shockerId, cmd.type, cmd.intensity, cmd.transmitEnd)) {
225-
OS_LOGD(TAG, "[pin-%hhi] Failed to add sequence");
225+
OS_LOGD(TAG, "[pin-%hhi] Failed to add sequence", m_txPin);
226226
}
227227
}
228228

src/radio/rmt/Sequence.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ inline static bool fillSequenceImpl(rmt_data_t* data, ShockerModelType modelType
3434
case ShockerModelType::Petrainer998DR:
3535
return Rmt::Petrainer998DREncoder::FillBuffer(data, shockerId, commandType, intensity);
3636
default:
37-
OS_LOGE(TAG, "Unknown shocker model: %u", modelType);
37+
OS_LOGE(TAG, "Unknown shocker model: %hhu", static_cast<uint8_t>(modelType));
3838
return false;
3939
}
4040
}

0 commit comments

Comments
 (0)