summaryrefslogtreecommitdiff
path: root/libddekit/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libddekit/printf.c')
-rw-r--r--libddekit/printf.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/libddekit/printf.c b/libddekit/printf.c
new file mode 100644
index 00000000..fb13a0b4
--- /dev/null
+++ b/libddekit/printf.c
@@ -0,0 +1,46 @@
+/*
+ * \brief Logging facility with printf()-like interface
+ * \author Thomas Friebel <yaron@yaron.de>
+ * \date 2006-03-01
+ */
+
+#include <l4/dde/ddekit/printf.h>
+
+#include <l4/log/l4log.h>
+
+/**
+ * Log constant string message w/o arguments
+ *
+ * \param msg message to be logged
+ */
+int ddekit_print(const char *msg)
+{
+ return LOG_printf("%s", msg);
+}
+
+/**
+ * Log message with print()-like arguments
+ *
+ * \param fmt format string followed by optional arguments
+ */
+int ddekit_printf(const char *fmt, ...)
+{
+ int res;
+ va_list va;
+
+ va_start(va, fmt);
+ res = ddekit_vprintf(fmt, va);
+ va_end(va);
+
+ return res;
+}
+
+/* Log message with vprintf()-like arguments
+ *
+ * \param fmt format string
+ * \param va variable argument list
+ */
+int ddekit_vprintf(const char *fmt, va_list va)
+{
+ return LOG_vprintf(fmt, va);
+}