Change important printfs to lg::print (#3355)

This allows them to be logged into a file, useful for debugging.

With this, GOAL `format` and C-kernel `Msg` (and its variants) will be
logged.
This commit is contained in:
ManDude
2024-02-01 18:01:41 +00:00
committed by GitHub
parent b331d16bcc
commit d67b441dac
21 changed files with 124 additions and 80 deletions
+8 -7
View File
@@ -7,6 +7,7 @@
#include "common/cross_os_debug/xdbg.h"
#include "common/listener_common.h"
#include "common/log/log.h"
#include "game/kernel/common/Ptr.h"
#include "game/kernel/common/fileio.h"
@@ -186,37 +187,37 @@ void cprintf(const char* format, ...) {
/*!
* Print directly to the C stdout
* The "k" parameter is ignored, so this is just like printf
* DONE, EXACT
* DONE, changed vprintf to lg::printstd
*/
void Msg(s32 k, const char* format, ...) {
(void)k;
va_list args;
va_start(args, format);
vprintf(format, args);
lg::printstd(format, args);
va_end(args);
}
/*!
* Print directly to the C stdout
* This is idential to Msg
* DONE, EXACT
* DONE, changed vprintf to lg::printstd
*/
void MsgWarn(const char* format, ...) {
va_list args;
va_start(args, format);
vprintf(format, args);
lg::printstd(format, args);
va_end(args);
}
/*!
* Print directly to the C stdout
* This is idential to Msg
* DONE, EXACT
* DONE, changed vprintf to lg::printstd
*/
void MsgErr(const char* format, ...) {
va_list args;
va_start(args, format);
vprintf(format, args);
lg::printstd(format, args);
va_end(args);
}
@@ -572,4 +573,4 @@ char* kitoa(char* buffer, s64 value, u64 base, s32 length, char pad, u32 flag) {
*/
void kqtoa() {
ASSERT(false);
}
}