From 90d13e57085942b7b193088f18193e9228b0173e Mon Sep 17 00:00:00 2001 From: CreeperMario Date: Sun, 6 Aug 2017 17:42:43 +0930 Subject: [PATCH] libwhb: Add a simplistic Cafe Log handler --- src/libwhb/include/whb/log_cafe.h | 21 +++++++++++++++++++++ src/libwhb/src/log_cafe.c | 15 +++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/libwhb/include/whb/log_cafe.h create mode 100644 src/libwhb/src/log_cafe.c diff --git a/src/libwhb/include/whb/log_cafe.h b/src/libwhb/include/whb/log_cafe.h new file mode 100644 index 0000000..bc40515 --- /dev/null +++ b/src/libwhb/include/whb/log_cafe.h @@ -0,0 +1,21 @@ +#pragma once +#include + +/** + * \defgroup whb_log_cafe Cafe OS System Log Output + * \ingroup whb + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL +WHBLogCafeInit(); + +#ifdef __cplusplus +} +#endif + +/** @} */ diff --git a/src/libwhb/src/log_cafe.c b/src/libwhb/src/log_cafe.c new file mode 100644 index 0000000..a1367d3 --- /dev/null +++ b/src/libwhb/src/log_cafe.c @@ -0,0 +1,15 @@ +#include +#include + +static void +cafeLogHandler(const char * msg) +{ + OSReport("%s\n", msg); +} + +BOOL +WHBLogCafeInit() +{ + WHBAddLogHandler(cafeLogHandler); + return TRUE; +}