From c3503ce1882ffef3097e3b887234399b12af4644 Mon Sep 17 00:00:00 2001 From: Daniel Widgren Date: Mon, 29 Jun 2026 19:59:39 +0200 Subject: [PATCH] docs(sandbox): stop referencing a non-existent game.log API print/eprint are stripped from the sandbox and no logging binding is registered, so there is no in-script logging facility. The sandbox guide and the loader comment both directed users to an asobi-side `game.log` API that does not exist. State the actual situation instead: surface diagnostics through game state or broadcast events. --- guides/security-sandbox.md | 5 +++-- src/lua/asobi_lua_loader.erl | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/guides/security-sandbox.md b/guides/security-sandbox.md index b42d3da..ffde967 100644 --- a/guides/security-sandbox.md +++ b/guides/security-sandbox.md @@ -16,8 +16,9 @@ script cannot reach them: - **Package machinery:** the entire `package` library, plus the default `require` - **Unstructured logging:** `print`, `eprint` — Luerl's defaults bypass - the structured logger and write straight to BEAM stdout. Scripts that - need to log should go through the asobi-side `game.log` API. + the structured logger and write straight to BEAM stdout. There is + currently no in-script logging API; surface diagnostics through game + state or broadcast events instead. `os.clock`, `os.date`, `os.difftime`, and `os.time` remain available so games can timestamp. diff --git a/src/lua/asobi_lua_loader.erl b/src/lua/asobi_lua_loader.erl index bac5545..6493065 100644 --- a/src/lua/asobi_lua_loader.erl +++ b/src/lua/asobi_lua_loader.erl @@ -219,8 +219,9 @@ strip_dangerous_globals(St) -> %% L-1: `print` and `eprint` are stripped here because Luerl's %% defaults call `io:format` directly to the BEAM stdout, which %% breaks the structured JSON log stream and lets a tight loop - %% flood the runtime's logging driver. Scripts that need to log - %% should go through the asobi-side `game.log` API. + %% flood the runtime's logging driver. There is currently no + %% in-script logging API; scripts surface diagnostics through game + %% state or broadcast events. Paths = [ [~"os", ~"execute"], [~"os", ~"exit"],