logs: Don't create logs on non debug builds

This commit is contained in:
Joel16 2024-11-22 11:30:38 +00:00
parent ba3d5e0529
commit 32ba683bfb
2 changed files with 11 additions and 3 deletions

View File

@ -61,8 +61,9 @@ namespace GUI {
guiSizeBuf = C2D_TextBufNew(4096);
Textures::Init();
#if defined BUILD_DEBUG
Log::Open();
#endif
// Real time services
#if !defined BUILD_CITRA
mcuHwcInit();
@ -81,7 +82,9 @@ namespace GUI {
#if !defined BUILD_CITRA
mcuHwcExit();
#endif
#if defined BUILD_DEBUG
Log::Close();
#endif
Textures::Exit();
C2D_TextBufDelete(guiSizeBuf);
C2D_TextBufDelete(guiDynamicBuf);

View File

@ -6,7 +6,7 @@
namespace Log {
static FS_Archive sdmcArchive;
static Handle handle;
static Handle handle = 0;
static u64 offset = 0;
Result Open(void) {
@ -44,7 +44,12 @@ namespace Log {
return 0;
}
void Error(const char *data, ...) {
void Error(const char *data, ...) {
// File handle was not open for writing
if (!handle) {
return;
}
char buf[256];
va_list args;
va_start(args, data);