Skip to content

Commit 2efcd5f

Browse files
committed
opt(mqtt): 添加mosquitto错误字串的打印
1 parent dbcf43f commit 2efcd5f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/mqtt/client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ void Client::OnLogWrapper(struct mosquitto *, void *userdata, int level, const c
504504
void Client::onConnected(int rc)
505505
{
506506
if (rc != 0) {
507-
LogWarn("connect fail, rc:%d", rc);
507+
LogWarn("connect fail, rc:%d, %s", rc, mosquitto_strerror(rc));
508508
return;
509509
}
510510

@@ -523,7 +523,7 @@ void Client::onConnected(int rc)
523523
void Client::onDisconnected(int rc)
524524
{
525525
RECORD_SCOPE();
526-
LogNotice("disconnected, rc:%d", rc);
526+
LogNotice("disconnected, rc:%d, %s", rc, mosquitto_strerror(rc));
527527
handleDisconnectEvent();
528528
}
529529

@@ -615,7 +615,7 @@ void Client::onTcpConnectDone(int ret)
615615
updateStateTo(State::kTcpConnected);
616616

617617
} else {
618-
LogNotice("connect fail, rc:%d", ret);
618+
LogNotice("connect fail, rc:%d, %s", ret, mosquitto_strerror(ret));
619619
tryReconnect();
620620

621621
++d_->cb_level;

version.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
# TBOX版本号
2222
TBOX_VERSION_MAJOR := 1
2323
TBOX_VERSION_MINOR := 10
24-
TBOX_VERSION_REVISION := 17
24+
TBOX_VERSION_REVISION := 18

0 commit comments

Comments
 (0)