Modify log level

pull/12854/head
chendongsheng 4 years ago
parent 2f06178fa9
commit 0b83f0f18b

@ -279,10 +279,10 @@ void AbstractNode::StartHeartbeatTimer(const std::shared_ptr<TcpClient> &client)
heart_beat_thread_ = std::make_unique<std::thread>([&]() { heart_beat_thread_ = std::make_unique<std::thread>([&]() {
while (!is_finish_.load()) { while (!is_finish_.load()) {
if (!Heartbeat(client)) { if (!Heartbeat(client)) {
MS_LOG(ERROR) << "The node role is:" << CommUtil::NodeRoleToString(node_info_.node_role_) MS_LOG(WARNING) << "The node role is:" << CommUtil::NodeRoleToString(node_info_.node_role_)
<< ", the node id is:" << node_info_.node_id_ << " Send heartbeat timeout!"; << ", the node id is:" << node_info_.node_id_ << " Send heartbeat timeout!";
if (!CheckSchedulerTimeout() && on_node_event_message_) { if (!CheckSchedulerTimeout() && on_node_event_message_) {
MS_LOG(ERROR) << "The node role is:" << CommUtil::NodeRoleToString(node_info_.node_role_) MS_LOG(WARNING) << "The node role is:" << CommUtil::NodeRoleToString(node_info_.node_role_)
<< ", the node id is:" << node_info_.node_id_ << " exited due to scheduler timeout!"; << ", the node id is:" << node_info_.node_id_ << " exited due to scheduler timeout!";
is_finish_ = true; is_finish_ = true;
wait_finish_cond_.notify_all(); wait_finish_cond_.notify_all();
@ -306,7 +306,7 @@ bool AbstractNode::Heartbeat(const std::shared_ptr<TcpClient> &client, bool is_n
if (!SendMessageSync(client, meta, Protos::PROTOBUF, heartbeat_message.SerializeAsString().data(), if (!SendMessageSync(client, meta, Protos::PROTOBUF, heartbeat_message.SerializeAsString().data(),
heartbeat_message.ByteSizeLong())) { heartbeat_message.ByteSizeLong())) {
MS_LOG(ERROR) << "The node id:" << node_info_.node_id_ << " Send heartbeat timeout!"; MS_LOG(WARNING) << "The node id:" << node_info_.node_id_ << " Send heartbeat timeout!";
} }
return true; return true;
} }

@ -220,12 +220,12 @@ void TcpClient::EventCallback(struct bufferevent *bev, std::int16_t events, void
SetTcpNoDelay(fd); SetTcpNoDelay(fd);
MS_LOG(INFO) << "Client connected!"; MS_LOG(INFO) << "Client connected!";
} else if (events & BEV_EVENT_ERROR) { } else if (events & BEV_EVENT_ERROR) {
MS_LOG(ERROR) << "Client connected error!"; MS_LOG(WARNING) << "Client connected BEV_EVENT_ERROR!";
if (tcp_client->disconnected_callback_) { if (tcp_client->disconnected_callback_) {
tcp_client->disconnected_callback_(); tcp_client->disconnected_callback_();
} }
} else if (events & BEV_EVENT_EOF) { } else if (events & BEV_EVENT_EOF) {
MS_LOG(ERROR) << "Client connected end of file"; MS_LOG(WARNING) << "Client connected end of file";
} }
} }

@ -375,7 +375,7 @@ void TcpServer::EventCallback(struct bufferevent *bev, std::int16_t events, void
srv->RemoveConnection(conn->GetFd()); srv->RemoveConnection(conn->GetFd());
bufferevent_free(bev); bufferevent_free(bev);
} else if (events & BEV_EVENT_ERROR) { } else if (events & BEV_EVENT_ERROR) {
MS_LOG(ERROR) << "Event buffer remain data: " << remain; MS_LOG(WARNING) << "Event buffer remain data: " << remain;
// Free connection structures // Free connection structures
srv->RemoveConnection(conn->GetFd()); srv->RemoveConnection(conn->GetFd());
bufferevent_free(bev); bufferevent_free(bev);
@ -385,7 +385,7 @@ void TcpServer::EventCallback(struct bufferevent *bev, std::int16_t events, void
srv->client_disconnection_(*srv, *conn); srv->client_disconnection_(*srv, *conn);
} }
} else { } else {
MS_LOG(ERROR) << "Unhandled event!"; MS_LOG(WARNING) << "Unhandled event!";
} }
} }

Loading…
Cancel
Save