From b206234fd0412521f565a0c43efc5d3fb69f7386 Mon Sep 17 00:00:00 2001 From: irisz64 Date: Tue, 22 Jul 2025 16:40:40 +0200 Subject: [PATCH] make log macros more concise --- src/utils/log.hpp | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/src/utils/log.hpp b/src/utils/log.hpp index 526f3820..ef538b30 100644 --- a/src/utils/log.hpp +++ b/src/utils/log.hpp @@ -28,33 +28,11 @@ void print(const std::format_string fmt, Args... args) { } } -#define panic(fmt, ...) do \ - { \ - Util::print("[FATAL] " fmt, __VA_ARGS__); \ - exit(-1); \ - } while(0) -#define error(fmt, ...) do \ - { \ - Util::print("[ERROR] " fmt, __VA_ARGS__); \ - } while(0) -#define warn(fmt, ...) do \ - { \ - Util::print("[WARN] " fmt, __VA_ARGS__); \ - } while(0) -#define info(fmt, ...) do \ - { \ - Util::print("[INFO] " fmt, __VA_ARGS__); \ - } while(0) -#define debug(fmt, ...) do \ - { \ - Util::print("[DEBUG] " fmt, __VA_ARGS__); \ - } while(0) -#define trace(fmt, ...) do \ - { \ - Util::print("[TRACE] " fmt, __VA_ARGS__); \ - } while(0) -#define always(fmt, ...) do \ - { \ - Util::print(fmt, __VA_ARGS__); \ - } while(0) +#define panic(fmt, ...) do { Util::print("[FATAL] " fmt, __VA_ARGS__); exit(-1); } while(0) +#define error(fmt, ...) do { Util::print("[ERROR] " fmt, __VA_ARGS__); } while(0) +#define warn(fmt, ...) do { Util::print("[WARN] " fmt, __VA_ARGS__); } while(0) +#define info(fmt, ...) do { Util::print("[INFO] " fmt, __VA_ARGS__); } while(0) +#define debug(fmt, ...) do { Util::print("[DEBUG] " fmt, __VA_ARGS__); } while(0) +#define trace(fmt, ...) do { Util::print("[TRACE] " fmt, __VA_ARGS__); } while(0) +#define always(fmt, ...) do { Util::print(fmt, __VA_ARGS__); } while(0) } // namespace Util