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