From 5925f851c4534cd973079dc2e50141d8f6821523 Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Thu, 2 May 2024 15:09:21 +0200 Subject: [PATCH] trace can now be used in debug mode --- Makefile | 2 +- src/kernel/log/Log.hx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5ed7dd9..d28698e 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ UNPACK_POLYFILLED_PATH := $(BUILD_DIR)/$(UNPACK_POLYFILLED_NAME) all: clean build unpack -build: HAXE_FLAGS += -D analyzer-optimize +build: HAXE_FLAGS += -D analyzer-optimize --no-traces build: $(MIN_PATH) debug: HAXE_FLAGS += -D webconsole -D error_stack --debug diff --git a/src/kernel/log/Log.hx b/src/kernel/log/Log.hx index e447dfb..75f07f7 100644 --- a/src/kernel/log/Log.hx +++ b/src/kernel/log/Log.hx @@ -21,6 +21,12 @@ class Log { @:allow(kernel.Init) private static function init() { onLog = onLogTrigger.asSignal(); + + #if debug + haxe.Log.trace = function(v:Dynamic, ?infos:haxe.PosInfos) { + Log.debug(v, infos); + } + #end } public static function info(msg:Dynamic, ?pos:haxe.PosInfos) {