git » sdk » commit 58b85b5

Gate nodejs logs behind env var

author Stephen Paul Weber
2026-05-11 15:00:00 UTC
committer Stephen Paul Weber
2026-05-11 15:00:00 UTC
parent 1093b4a5c98528ada9461b1706bae33332f0dd7f

Gate nodejs logs behind env var

borogove/Util.hx +3 -0

diff --git a/borogove/Util.hx b/borogove/Util.hx
index b3b1bea..9ee7538 100644
--- a/borogove/Util.hx
+++ b/borogove/Util.hx
@@ -32,6 +32,9 @@ class DummyRequireMacro {
 function setupTrace() {
 #if js
 	haxe.Log.trace = (v, ?infos) -> {
+#if nodejs
+		if (!js.Syntax.code("globalThis.process?.env?.BOROGOVE_DEBUG")) return;
+#end
 		if (js.Syntax.typeof(untyped console) != "undefined" && (untyped console).debug != null) {
 			final params = infos.customParams ?? [];
 			infos.customParams = [];