summaryrefslogtreecommitdiffstats
path: root/src/LoggerSimple.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-05-05 23:52:14 +0200
committerGitHub <noreply@github.com>2020-05-05 23:52:14 +0200
commit57952505e522be868a5a8270d8670163b55ebade (patch)
treecf3c5544612b8a51075b498fa14dba8fe758d656 /src/LoggerSimple.h
parentRequire semi-colon at end of function-like macros (#4719) (diff)
downloadcuberite-57952505e522be868a5a8270d8670163b55ebade.tar
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.gz
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.bz2
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.lz
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.xz
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.zst
cuberite-57952505e522be868a5a8270d8670163b55ebade.zip
Diffstat (limited to 'src/LoggerSimple.h')
-rw-r--r--src/LoggerSimple.h76
1 files changed, 54 insertions, 22 deletions
diff --git a/src/LoggerSimple.h b/src/LoggerSimple.h
index 5c0487607..83d1c4e86 100644
--- a/src/LoggerSimple.h
+++ b/src/LoggerSimple.h
@@ -4,31 +4,63 @@
// python style format specified logging
-extern void FLOG(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, FLOG, const char *)
-
-extern void FLOGINFO(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, FLOGINFO, const char *)
-
-extern void FLOGWARNING(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, FLOGWARNING, const char *)
-
-extern void FLOGERROR(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, FLOGERROR, const char *)
+extern void vFLOG(const char * a_Format, fmt::format_args a_ArgList);
+template <typename... Args>
+void FLOG(const char * a_Format, const Args & ... args)
+{
+ vFLOG(a_Format, fmt::make_format_args(args...));
+}
+
+extern void vFLOGINFO(const char * a_Format, fmt::format_args a_ArgList);
+template <typename... Args>
+void FLOGINFO(const char * a_Format, const Args & ... args)
+{
+ vFLOGINFO(a_Format, fmt::make_format_args(args...));
+}
+
+extern void vFLOGWARNING(const char * a_Format, fmt::format_args a_ArgList);
+template <typename... Args>
+void FLOGWARNING(const char * a_Format, const Args & ... args)
+{
+ vFLOGWARNING(a_Format, fmt::make_format_args(args...));
+}
+
+extern void vFLOGERROR(const char * a_Format, fmt::format_args a_ArgList);
+template <typename... Args>
+void FLOGERROR(const char * a_Format, const Args & ... args)
+{
+ vFLOGERROR(a_Format, fmt::make_format_args(args...));
+}
// printf style format specified logging (DEPRECATED)
-extern void LOG(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, LOG, const char *)
-
-extern void LOGINFO(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, LOGINFO, const char *)
-
-extern void LOGWARNING(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, LOGWARNING, const char *)
-
-extern void LOGERROR(const char * a_Format, fmt::ArgList a_ArgList);
-FMT_VARIADIC(void, LOGERROR, const char *)
+extern void vLOG(const char * a_Format, fmt::printf_args a_ArgList);
+template <typename... Args>
+void LOG(const char * a_Format, const Args & ... args)
+{
+ vLOG(a_Format, fmt::make_printf_args(args...));
+}
+
+extern void vLOGINFO(const char * a_Format, fmt::printf_args a_ArgList);
+template <typename... Args>
+void LOGINFO(const char * a_Format, const Args & ... args)
+{
+ vLOGINFO(a_Format, fmt::make_printf_args(args...));
+}
+
+extern void vLOGWARNING(const char * a_Format, fmt::printf_args a_ArgList);
+template <typename... Args>
+void LOGWARNING(const char * a_Format, const Args & ... args)
+{
+ vLOGWARNING(a_Format, fmt::make_printf_args(args...));
+}
+
+extern void vLOGERROR(const char * a_Format, fmt::printf_args a_ArgList);
+template <typename... Args>
+void LOGERROR(const char * a_Format, const Args & ... args)
+{
+ vLOGERROR(a_Format, fmt::make_printf_args(args...));
+}
// Macro variants