Skip to content

smelt.messages

Tier: Host — Available in every runtime, including headless mode.

Persistent message log with full bodies and tracebacks.

smelt.messages.append

fun(kind: string, source: string, msg: string): nil

Append a new message of kind ("error", "warn"/"warning", anything else falls back to "info") attributed to source with body msg.

smelt.messages.clear

fun(): nil

Drop every message from the log.

smelt.messages.count

fun(): integer

Return the total number of messages currently in the log.

smelt.messages.list

fun(): table

Return every persisted message as rows of { kind, source, summary, full, ts_ms }, ordered oldest-first.

smelt.messages.mark_read

fun(): nil

Mark every message in the log as read so unread_count returns 0 until new errors arrive.

smelt.messages.unread_count

fun(): integer

Return the number of unread error messages in the log.