summaryrefslogtreecommitdiffstats
path: root/src/LoggerSimple.h
diff options
context:
space:
mode:
authorx12xx12x <44411062+12xx12@users.noreply.github.com>2021-11-26 00:51:47 +0100
committerAlexander Harkness <me@bearbin.net>2022-01-14 20:43:29 +0100
commit250b8eb652a57dcbdff4af7b6efb9c2554b45798 (patch)
tree1d8bf1aaeac6974d75c83524c8000161d8cc104c /src/LoggerSimple.h
parentFix WriteXZYPosition64 and add tests (diff)
downloadcuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.gz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.bz2
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.lz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.xz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.zst
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.zip
Diffstat (limited to 'src/LoggerSimple.h')
-rw-r--r--src/LoggerSimple.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/LoggerSimple.h b/src/LoggerSimple.h
index 7c984d2ca..37ed36bc6 100644
--- a/src/LoggerSimple.h
+++ b/src/LoggerSimple.h
@@ -94,3 +94,12 @@ void LOGERROR(std::string_view a_Format, const Args & ... args)
#endif // !NDEBUG
#define FLOGWARN FLOGWARNING
+
+// Conditionally log a warning
+#define CONDWARNING(ShouldLog, ...) \
+ do { \
+ if (ShouldLog) \
+ { \
+ LOGWARNING(__VA_ARGS__); \
+ } \
+ } while (false)