RUSTICDOCSSearch documentation

Logging API

Send a bounded diagnostic message to the live game console.

When to call it

Log lifecycle transitions and recoverable errors. Avoid per-frame logging outside short debugging sessions because bounded queues can drop excessive output.

Calls

  • rustic.log(level, message, fields?)
  • print(...) — Lua and JavaScript info
  • warn(...) — Lua and JavaScript warning

Variables

VariableTypeRequiredDescription
levelstringYesdebug, info, warn, or error.
messagestringYesHuman-readable diagnostic text.
fieldstable / objectNoOptional structured fields where supported; omit for portability.

Return and timing

No value. The message is queued for the bounded console sink.

Language examples

Lua 5.4

lua
rustic.log('info', 'player spawned')

JavaScript

javascript
rustic.log('info', 'player spawned');

Python

python
rustic.log('info', 'player spawned')

C++

cpp
rustic.log("info", "player spawned");

C#

csharp
rustic.log("info", "player spawned");

Luau

lua
rustic.log('info', 'player spawned')

C

c
rustic.log("info", "player spawned");

Java

java
rustic.log("info", "player spawned");

PHP

php
$rustic->log('info', 'player spawned');

HTML / inline JS

javascript
rustic.log('info', 'player spawned');

Constraints and behavior

  • In Lua and JavaScript, print(...) writes an info entry and warn(...) writes a warning entry to the Rustic Console. Lua separates multiple arguments with tabs; JavaScript separates them with spaces. Use rustic.log for an explicit level. External programs must not print diagnostics to stdout; stdout is reserved for protocol responses.
  • Every gameplay language calls the engine-owned API. Rustic supplies SDKs and dispatches callbacks; scripts do not parse requests or serialize responses. See the language guide for complete setup and callback registration.