← Debug output

Debug.warn

luastra/debug
Debug.warn(...: any): nil

Emits a warning-level development diagnostic for an unexpected but recoverable condition. Hosts may distinguish it visually from normal logs while preserving the same bounded argument handling.

Before you use it

Add luastra/debug to this module's dependencies in luastra.json, then import it with require("luastra/debug"). No additional host capability is required. Keep user-visible errors in UI state rather than relying on a developer console.

How it fits

The call writes a synchronous development diagnostic. It neither changes application state nor throws merely because the error log level is used.

When to use it

Use Debug.warn when the application can continue but a fallback, stale value, or unusual branch deserves developer attention. User-correctable validation belongs in the UI, not only in the debug console.

Parameters

ParameterType / valuesDescription
...anyChecked ... argument accepted by Debug.warn.

Returns

nil — the exact nil value declared by the SDK contract.

What happens next

A prefixed diagnostic appears in the active host's development log.

Failures and fixes

Never include secrets or personal data. Logging is not telemetry, recovery, or user-facing error handling, and host presentation may differ.

Availability

Public-source alpha diagnostic API in 0.5.0-alpha.

Focused example

local Debug = require("luastra/debug")
Debug.warn("storage", "snapshot was empty")

Complete inventory

View all pages in Debug output
← Previous: Debug.logNext: Debug.error →