Migrate from fmt/format to std/format
This commit is contained in:
@ -34,10 +34,8 @@ set(dependencies
|
||||
esp_hw_support
|
||||
esp_websocket_client
|
||||
tcp_transport
|
||||
|
||||
cpputils
|
||||
espchrono
|
||||
fmt
|
||||
)
|
||||
|
||||
idf_component_register(
|
||||
|
@ -5,13 +5,11 @@
|
||||
|
||||
// system includes
|
||||
#include <utility>
|
||||
#include <format>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <fmt/core.h>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
namespace espcpputils {
|
||||
@ -27,7 +25,7 @@ std::string toString(sntp_sync_mode_t val)
|
||||
case SNTP_SYNC_MODE_SMOOTH: return "SMOOTH";
|
||||
default:
|
||||
ESP_LOGW(TAG, "unknown sntp_sync_mode_t(%i)", std::to_underlying(val));
|
||||
return fmt::format("Unknown sntp_sync_mode_t({})", std::to_underlying(val));
|
||||
return std::format("Unknown sntp_sync_mode_t({})", std::to_underlying(val));
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +38,7 @@ std::string toString(sntp_sync_status_t val)
|
||||
case SNTP_SYNC_STATUS_IN_PROGRESS: return "IN_PROGRESS";
|
||||
default:
|
||||
ESP_LOGW(TAG, "unknown sntp_sync_status_t(%i)", std::to_underlying(val));
|
||||
return fmt::format("Unknown sntp_sync_status_t({})", std::to_underlying(val));
|
||||
return std::format("Unknown sntp_sync_status_t({})", std::to_underlying(val));
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +54,7 @@ std::string toString(esp_log_level_t val)
|
||||
case ESP_LOG_VERBOSE: return "VERBOSE";
|
||||
default:
|
||||
ESP_LOGW(TAG, "unknown esp_log_level_t(%i)", std::to_underlying(val));
|
||||
return fmt::format("Unknown esp_log_level_t({})", std::to_underlying(val));
|
||||
return std::format("Unknown esp_log_level_t({})", std::to_underlying(val));
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +75,7 @@ std::string toString(esp_reset_reason_t val)
|
||||
case ESP_RST_SDIO: return "SDIO";
|
||||
default:
|
||||
ESP_LOGW(TAG, "unknown esp_reset_reason_t(%i)", std::to_underlying(val));
|
||||
return fmt::format("Unknown esp_reset_reason_t({})", std::to_underlying(val));
|
||||
return std::format("Unknown esp_reset_reason_t({})", std::to_underlying(val));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user