trace can now be used in debug mode

This commit is contained in:
Niklas Kapelle 2024-05-02 15:09:21 +02:00
parent d13831f213
commit 5925f851c4
Signed by: niklas
GPG Key ID: 4EB651B36D841D16
2 changed files with 7 additions and 1 deletions

View File

@ -22,7 +22,7 @@ UNPACK_POLYFILLED_PATH := $(BUILD_DIR)/$(UNPACK_POLYFILLED_NAME)
all: clean build unpack all: clean build unpack
build: HAXE_FLAGS += -D analyzer-optimize build: HAXE_FLAGS += -D analyzer-optimize --no-traces
build: $(MIN_PATH) build: $(MIN_PATH)
debug: HAXE_FLAGS += -D webconsole -D error_stack --debug debug: HAXE_FLAGS += -D webconsole -D error_stack --debug

View File

@ -21,6 +21,12 @@ class Log {
@:allow(kernel.Init) @:allow(kernel.Init)
private static function init() { private static function init() {
onLog = onLogTrigger.asSignal(); 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) { public static function info(msg:Dynamic, ?pos:haxe.PosInfos) {