zephyr

Top-level helpers available directly on the global `zephyr` table.

2 functions

log

zephyr.log(level, message)

Write a line to the host log under the zephyr::lua target.

Parameters

levelstring

One of trace, debug, warn, or error. Any other value logs at info.

messagestring

Message to log.

Returns

nil

Nothing.

Example

lua
zephyr.log("info", "module started")

sleep_ms

zephyr.sleep_ms(ms)

Asynchronously sleep for the given number of milliseconds.

Parameters

msnumber

Milliseconds to sleep.

Returns

nil

Nothing. Yields the current coroutine while sleeping.

Example

lua
zephyr.sleep_ms(250)