Try to log via the logging module, also log to syslog via OSReport

This commit is contained in:
Maschell 2021-11-06 23:37:52 +01:00
parent 2f389672df
commit 4c34943c86
4 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
FROM wiiuenv/devkitppc:20210920
FROM wiiuenv/devkitppc:20211106
COPY --from=wiiuenv/wiiumodulesystem:20211031 /artifacts $DEVKITPRO

View File

@ -17,6 +17,7 @@ IMPORT(MEMGetAllocatableSizeForExpHeapEx);
IMPORT(MEMCreateExpHeapEx);
IMPORT(OSUninterruptibleSpinLock_Acquire);
IMPORT(OSUninterruptibleSpinLock_Release);
IMPORT(OSReport);
IMPORT_END();

View File

@ -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;

View File

@ -8,6 +8,8 @@
#include <nn/act/client_cpp.h>
#include <coreinit/dynload.h>
#include <whb/log_udp.h>
#include <whb/log_cafe.h>
#include <whb/log_module.h>
#include <vector>
#include "fs/DirList.h"
@ -70,7 +72,10 @@ bool doRelocation(std::vector<RelocationData> &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.