make log macros more concise
This commit is contained in:
@@ -28,33 +28,11 @@ void print(const std::format_string<Args...> fmt, Args... args) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define panic(fmt, ...) do \
|
#define panic(fmt, ...) do { Util::print<Util::Error>("[FATAL] " fmt, __VA_ARGS__); exit(-1); } while(0)
|
||||||
{ \
|
#define error(fmt, ...) do { Util::print<Util::Error>("[ERROR] " fmt, __VA_ARGS__); } while(0)
|
||||||
Util::print<Util::Error>("[FATAL] " fmt, __VA_ARGS__); \
|
#define warn(fmt, ...) do { Util::print<Util::Warn>("[WARN] " fmt, __VA_ARGS__); } while(0)
|
||||||
exit(-1); \
|
#define info(fmt, ...) do { Util::print<Util::Info>("[INFO] " fmt, __VA_ARGS__); } while(0)
|
||||||
} while(0)
|
#define debug(fmt, ...) do { Util::print<Util::Debug>("[DEBUG] " fmt, __VA_ARGS__); } while(0)
|
||||||
#define error(fmt, ...) do \
|
#define trace(fmt, ...) do { Util::print<Util::Trace>("[TRACE] " fmt, __VA_ARGS__); } while(0)
|
||||||
{ \
|
#define always(fmt, ...) do { Util::print<Util::Always>(fmt, __VA_ARGS__); } while(0)
|
||||||
Util::print<Util::Error>("[ERROR] " fmt, __VA_ARGS__); \
|
|
||||||
} while(0)
|
|
||||||
#define warn(fmt, ...) do \
|
|
||||||
{ \
|
|
||||||
Util::print<Util::Warn>("[WARN] " fmt, __VA_ARGS__); \
|
|
||||||
} while(0)
|
|
||||||
#define info(fmt, ...) do \
|
|
||||||
{ \
|
|
||||||
Util::print<Util::Info>("[INFO] " fmt, __VA_ARGS__); \
|
|
||||||
} while(0)
|
|
||||||
#define debug(fmt, ...) do \
|
|
||||||
{ \
|
|
||||||
Util::print<Util::Debug>("[DEBUG] " fmt, __VA_ARGS__); \
|
|
||||||
} while(0)
|
|
||||||
#define trace(fmt, ...) do \
|
|
||||||
{ \
|
|
||||||
Util::print<Util::Trace>("[TRACE] " fmt, __VA_ARGS__); \
|
|
||||||
} while(0)
|
|
||||||
#define always(fmt, ...) do \
|
|
||||||
{ \
|
|
||||||
Util::print<Util::Always>(fmt, __VA_ARGS__); \
|
|
||||||
} while(0)
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|||||||
Reference in New Issue
Block a user