From 0893984069f0cecaa298ebdce0e01eb8fddd298c Mon Sep 17 00:00:00 2001 From: Michael Haberler Date: Fri, 20 Oct 2023 13:44:40 +0200 Subject: [PATCH] test fmt-10.1.1 and spedlog v1.12.0 - ok --- platformio.ini | 8 +++++--- src/main.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index de47ad8..94cadf9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,7 +12,9 @@ platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5 framework = arduino build_flags = - -DFMT_HEADER_ONLY + -DTEST_SPDLOG + ; -std=c++20 + ; -DFMT_HEADER_ONLY -DBOARD_HAS_PSRAM -DEMBEDDED ; for fmtlib -DSPDLOG_COMPILED_LIB ; for spdlog @@ -38,5 +40,5 @@ debug_speed = 40000 lib_deps = https://github.com/mhaberler/M5GFX.git#arduino-3.0 m5stack/M5Unified@^0.1.10 - https://github.com/mhaberler/fmtlib#mah-10.0.0 - /home/mah/src/spdlog \ No newline at end of file + https://github.com/mhaberler/fmtlib#mah-10.1.1 + https://github.com/gabime/spdlog#v1.12.0 diff --git a/src/main.cpp b/src/main.cpp index f153cb9..da23452 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ #undef B1 // fmt workaround #undef F #include +#ifdef TEST_SPDLOG #include #include @@ -11,6 +12,7 @@ #include "spdlog/fmt/bin_to_hex.h" auto main_log = spdlog::stdout_color_mt("main", spdlog::color_mode::always); +#endif M5GFX display; @@ -36,7 +38,7 @@ void setup(void) M5.begin(cfg); std::string s = fmt::format("The answer is {}.", 42); - +#ifdef TEST_SPDLOG spdlog::set_level(spdlog::level::trace); // Set global log level to trace spdlog::set_pattern("[%t] [%C-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v"); @@ -51,7 +53,7 @@ void setup(void) std::array a; std::iota(a.begin(), a.end(), 1); main_log->critical("{:s:X}", spdlog::to_hex(a)); - +#endif display.init(); display.startWrite(); display.fillScreen(TFT_BLACK);