From 6594b50e57935dd66930ccd35dba7a1b4131399d Mon Sep 17 00:00:00 2001 From: memchr <118117622+memchr@users.noreply.github.com> Date: Wed, 20 Sep 2023 07:26:20 +0000 Subject: logging/format: use std::format_string to catch formatting string errors at compile time (#3377) * fix(log): use constexpr format string * deprecate getFormat --- src/macros.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/macros.hpp') diff --git a/src/macros.hpp b/src/macros.hpp index 3f0a9ebc..b4fe72d1 100644 --- a/src/macros.hpp +++ b/src/macros.hpp @@ -58,8 +58,8 @@ #define RASSERT(expr, reason, ...) \ if (!(expr)) { \ Debug::log(CRIT, "\n==========================================================================================\nASSERTION FAILED! \n\n{}\n\nat: line {} in {}", \ - getFormat(reason, ##__VA_ARGS__), __LINE__, \ - ([]() constexpr->std::string { return std::string(__FILE__).substr(std::string(__FILE__).find_last_of('/') + 1); })()); \ + std::format(reason, ##__VA_ARGS__), __LINE__, \ + ([]() constexpr -> std::string { return std::string(__FILE__).substr(std::string(__FILE__).find_last_of('/') + 1); })()); \ printf("Assertion failed! See the log in /tmp/hypr/hyprland.log for more info."); \ raise(SIGABRT); \ } -- cgit v1.2.3