summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-08-03 15:43:28 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-08-03 15:43:28 -0300
commitc68ef16c494a1c61bc702b7df0b21dc24d8eaf4f (patch)
tree0033cb36032106102a44a8b6986597a2a2d59d55
parent3b7d4c04106b01bbbedad81e62011eba74ab3c6c (diff)
log: Add `printlog()`
This works exactly like `printlog()`, except it uses variadic arguments.
-rw-r--r--log.c7
-rw-r--r--log.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/log.c b/log.c
index 12898f4..779fa4b 100644
--- a/log.c
+++ b/log.c
@@ -26,3 +26,10 @@ void vprintlog(log_output output_type, int priority, const char *fmt, va_list ar
}
free(buf);
}
+
+void printlog(log_output output_type, int priority, const char *fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ vprintlog(output_type, priority, fmt, args);
+ va_end(args);
+}
diff --git a/log.h b/log.h
index 08477e9..dea112f 100644
--- a/log.h
+++ b/log.h
@@ -13,6 +13,7 @@ enum log_output {
};
extern void vprintlog(log_output output_type, int priority, const char *fmt, va_list args);
+extern void printlog(log_output output_type, int priority, const char *fmt, ...);
#endif