From 4c34943c86b4e9291850cbf87d7dc11f7317d4a4 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 6 Nov 2021 23:37:52 +0100 Subject: [PATCH] Try to log via the logging module, also log to syslog via OSReport --- Dockerfile | 2 +- relocator/src/utils/imports.h | 1 + relocator/src/utils/logger.c | 1 + source/main.cpp | 7 ++++++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6fb2d84..79072ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM wiiuenv/devkitppc:20210920 +FROM wiiuenv/devkitppc:20211106 COPY --from=wiiuenv/wiiumodulesystem:20211031 /artifacts $DEVKITPRO diff --git a/relocator/src/utils/imports.h b/relocator/src/utils/imports.h index 8d2dec3..5a298cb 100644 --- a/relocator/src/utils/imports.h +++ b/relocator/src/utils/imports.h @@ -17,6 +17,7 @@ IMPORT(MEMGetAllocatableSizeForExpHeapEx); IMPORT(MEMCreateExpHeapEx); IMPORT(OSUninterruptibleSpinLock_Acquire); IMPORT(OSUninterruptibleSpinLock_Release); +IMPORT(OSReport); IMPORT_END(); diff --git a/relocator/src/utils/logger.c b/relocator/src/utils/logger.c index ddaf04d..ad8f213 100644 --- a/relocator/src/utils/logger.c +++ b/relocator/src/utils/logger.c @@ -87,6 +87,7 @@ void log_deinit() { } void log_print(const char *str) { + OSReport(str); // socket is always 0 initially as it is in the BSS if (log_socket < 0) { return; diff --git a/source/main.cpp b/source/main.cpp index c2fdd3e..a879018 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include "fs/DirList.h" @@ -70,7 +72,10 @@ bool doRelocation(std::vector &relocData, relocation_trampolin_e } int main(int argc, char **argv) { - WHBLogUdpInit(); + if (!WHBLogModuleInit()) { + WHBLogCafeInit(); + WHBLogUdpInit(); + } // 0x100 because before the .text section is a .init section // Currently the size of the .init is ~ 0x24 bytes. We substract 0x100 to be safe.