diff --git a/src/navigation.cpp b/src/navigation.cpp index 9593cdb..01559f7 100644 --- a/src/navigation.cpp +++ b/src/navigation.cpp @@ -15,9 +15,9 @@ void Navigation::Init() { try { client_ = std::make_unique(SLAM_SERVICE_NAME); client_->Init(); - LOG_INFO("Navigation client for service '{}' initialized.", SLAM_SERVICE_NAME); + LOG_INFO("Navigation client for service '" + SLAM_SERVICE_NAME + "' initialized."); } catch (const std::exception& e) { - LOG_ERROR("Failed to initialize navigation client: {}", e.what()); + LOG_ERROR("Failed to initialize navigation client: " + std::string(e.what())); } } @@ -32,29 +32,29 @@ bool Navigation::callSlamService(int api_id, const nlohmann::json& data) { std::string request_str = request_json.dump(); std::string response_str; - LOG_INFO("Calling slam service api_id: {}, request: {}", api_id, request_str); + LOG_INFO("Calling slam service api_id: " + std::to_string(api_id) + ", request: " + request_str); int ret = client_->Call(api_id, request_str, response_str); if (ret != 0) { - LOG_ERROR("Slam service request failed with SDK error code: {}", ret); + LOG_ERROR("Slam service request failed with SDK error code: " + std::to_string(ret)); return false; } - LOG_INFO("Slam service response: {}", response_str); + LOG_INFO("Slam service response: " + response_str); try { nlohmann::json response_json = nlohmann::json::parse(response_str); if (response_json.contains("succeed") && response_json["succeed"].get()) { - LOG_INFO("Slam service call for api_id {} succeeded. Info: {}", api_id, response_json.value("info", "")); + LOG_INFO("Slam service call for api_id " + std::to_string(api_id) + " succeeded. Info: " + response_json.value("info", "").get()); return true; } else { - LOG_ERROR("Slam service call for api_id {} failed. Error code: {}, Info: {}", - api_id, response_json.value("errorCode", -1), response_json.value("info", "")); + LOG_ERROR("Slam service call for api_id " + std::to_string(api_id) + " failed. Error code: " + + std::to_string(response_json.value("errorCode", -1).get()) + ", Info: " + response_json.value("info", "").get()); return false; } } catch (const nlohmann::json::parse_error& e) { - LOG_ERROR("Failed to parse slam service response: {}", e.what()); + LOG_ERROR("Failed to parse slam service response: " + std::string(e.what())); return false; } }