From d4875cd1eae20506dad132c489394283baee8353 Mon Sep 17 00:00:00 2001 From: jayden <46307433+krmeet@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:11:20 +0000 Subject: [PATCH] sacrifice debug info for readability --- src/pc/lua/smlua.h | 4 ++-- src/pc/lua/smlua_utils.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pc/lua/smlua.h b/src/pc/lua/smlua.h index 6cf32ca2..aad8d9a2 100644 --- a/src/pc/lua/smlua.h +++ b/src/pc/lua/smlua.h @@ -20,8 +20,8 @@ #include "pc/debuglog.h" #include "pc/djui/djui_console.h" -#define LOG_LUA(...) { if (!gSmLuaSuppressErrors) { _debuglog_print_log("LUA", __FILE__), printf(__VA_ARGS__), printf("\n"), smlua_mod_error(), snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), sys_swap_backslashes(gDjuiConsoleTmpBuffer), djui_console_message_create(gDjuiConsoleTmpBuffer, CONSOLE_MESSAGE_ERROR); } } -#define LOG_LUA_LINE(...) { if (!gSmLuaSuppressErrors) { _debuglog_print_log("LUA", __FILE__), printf(__VA_ARGS__), printf("\n"), smlua_mod_error(); snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), sys_swap_backslashes(gDjuiConsoleTmpBuffer), djui_console_message_create(gDjuiConsoleTmpBuffer, CONSOLE_MESSAGE_ERROR), smlua_logline(); } } +#define LOG_LUA(...) { if (!gSmLuaSuppressErrors) { printf("[LUA] "), printf(__VA_ARGS__), printf("\n"), smlua_mod_error(), snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), sys_swap_backslashes(gDjuiConsoleTmpBuffer), djui_console_message_create(gDjuiConsoleTmpBuffer, CONSOLE_MESSAGE_ERROR); } } +#define LOG_LUA_LINE(...) { if (!gSmLuaSuppressErrors) { printf("[LUA] "), printf(__VA_ARGS__), printf("\n"), smlua_mod_error(); snprintf(gDjuiConsoleTmpBuffer, CONSOLE_MAX_TMP_BUFFER, __VA_ARGS__), sys_swap_backslashes(gDjuiConsoleTmpBuffer), djui_console_message_create(gDjuiConsoleTmpBuffer, CONSOLE_MESSAGE_ERROR), smlua_logline(); } } #ifdef DEVELOPMENT #define LUA_STACK_CHECK_BEGIN() int __LUA_STACK_TOP = lua_gettop(gLuaState) diff --git a/src/pc/lua/smlua_utils.c b/src/pc/lua/smlua_utils.c index 011a809a..56746f4d 100644 --- a/src/pc/lua/smlua_utils.c +++ b/src/pc/lua/smlua_utils.c @@ -774,9 +774,9 @@ void smlua_logline(void) { int level = 0; while (lua_getstack(L, level, &info)) { lua_getinfo(L, "nSl", &info); - LOG_LUA(" [%d] %s:%d -- %s [%s]", + LOG_LUA("\t[%d] %s:%d -- %s [%s]", level, info.short_src, info.currentline, (info.name ? info.name : ""), info.what); ++level; } -} \ No newline at end of file +}