From c51a7e0153de646717de7a0cd898ac9d59e89ac2 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 5 Jan 2025 16:16:07 +0300 Subject: [PATCH] improve logging --- res/scripts/stdlib.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 86bdf999..4b5761ae 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -129,7 +129,7 @@ function events.emit(event, ...) for _, func in ipairs(handlers) do local status, newres = xpcall(func, __vc__error, ...) if not status then - print("error in event ("..event..") handler: "..newres) + debug.error("error in event ("..event..") handler: "..newres) else result = result or newres end @@ -197,9 +197,9 @@ local __post_runnables = {} function __process_post_runnables() if #__post_runnables then for _, func in ipairs(__post_runnables) do - local status, result = pcall(func) + local status, result = xpcall(func, __vc__error) if not status then - debug.log("error in post_runnable: "..result) + debug.error("error in post_runnable: "..result) end end __post_runnables = {}