API Reference

Complete reference for Echo’s logging, filtering, history, and tag APIs. For explanations and worked examples, start with the teaching pages; this page is for looking up exact capabilities.


Functions

Logging

EchoDebug(message, [urgency], [tag], [colour])

Logs a message at the chosen urgency and returns whether the current debug settings allowed it. If you set an allowed tag filter, untagged messages don't pass the filter. This is intentional. The colour is stored as metadata. Echo itself doesn't draw text. Echo Console uses the colour when showing structured history.

Arguments
message String The message to send to the debug logger
urgency optional Real The level of urgency of the debug message (pick an entry from the eEchoDebugUrgency enum)
tag optional String|Array<String> Optional tag or tags to filter on (e.g., "UI", ["Physics","Jump"]). Empty or empty array allows all.
colour optional Real|Undefined Optional text colour metadata for structured history / Echo Console display.
Returns
Bool
EchoDebugInfo(message, [tag], [colour])

Logs an INFO message. Info messages are only shown when the debug level is COMPLETE.

Arguments
message String
tag optional String|Array<String>
colour optional Real|Undefined
Returns
Bool
EchoDebugWarn(message, [tag], [colour])

Logs a WARNING message. Warning messages pass in COMPREHENSIVE and COMPLETE. In COMPLETE, warning messages include a stack trace.

Arguments
message String
tag optional String|Array<String>
colour optional Real|Undefined
Returns
Bool
EchoDebugSevere(message, [tag], [colour])

Logs a SEVERE message and includes a stack trace. Severe messages pass in SEVERE_ONLY, COMPREHENSIVE, and COMPLETE. Severe messages include a stack trace to make the call site easier to identify.

Arguments
message String
tag optional String|Array<String>
colour optional Real|Undefined
Returns
Bool

Debug level

EchoDebugSetLevel(level)

Sets which message urgency levels Echo will log. Returns false if the value isn't a valid debug level. This affects future logs only. It doesn't delete old history.

Arguments
level Real The level of logging (pick an entry from the eEchoDebugLevel enum)
Returns
Bool
EchoDebugGetLevel([stringify])

Returns the current eEchoDebugLevel value, or its name when _stringify is true.

Arguments
stringify optional Bool Whether to return the debug level as a string, or as the plain real value.
Returns
Real|String|Bool False if debug is disabled.

History and capture

EchoDebugDumpLog([raw])

Writes debug history to a text file. By default this dumps filtered history; pass true to dump raw history instead. The file name starts with echo_debug_dump-. This dumps the formatted text history, not every internal structured field. Returns false if the file can't be created.

Arguments
raw optional Bool Whether to dump raw history instead of filtered history.
Returns
Bool
EchoDebugGetHistorySize()

Returns the maximum number of entries kept in debug history. 0 means the history is unlimited.

Returns
Real|Bool False if debug is disabled.
EchoDebugSetHistorySize(max)

Sets how many entries debug history keeps. Use 0 for no limit. When the history is over the limit, Echo trims the oldest entries first.

Arguments
max Real
Returns
Bool
EchoDebugSetRawHistoryCapture(enabled)

Enables or disables raw history capture for the Echo Console. Raw history remembers messages before the current level and tag filters decide whether they belong in the normal log. Echo Console can then search messages that were filtered out when they happened. Raw capture can still retain messages while the debug level is NONE. They don't appear in the normal output or filtered history.

Arguments
enabled Bool
Returns
Bool
EchoDebugGetRawHistoryCapture()

Returns whether raw history capture is enabled for the Echo Console.

Returns
Bool False if debug is disabled.
EchoDebugClearHistory()

Clears all entries from the debug log history This clears the normal and raw histories, including both plain-text and structured entries.

Returns
Bool False if debug is disabled, otherwise true after clearing.
EchoDebugGetHistory()

Returns a copy of the current debug history.

Returns
Array<String>|Bool False if debug is disabled.
EchoDebugGetRevision()

Returns the current filtered-history revision number. This revision tracks filtered history only; raw history has its own internal revision.

Returns
Real|Bool False if debug is disabled.
EchoDebugGetStructuredHistory()

Returns a new array of structured history entries for UI rendering. A UI can use this to draw the message, urgency, tags, time, stack trace, or colour separately instead of parsing EchoDebugGetHistory() strings.

Returns
Array<Struct>|Bool False if debug is disabled.

Tags

EchoDebugSetTags(tags)

Sets which tags are allowed to log. An empty array means "allow all". If the allowed list isn't empty, a log must share at least one tag with that list.

Arguments
tags Array<String>
Returns
Bool
EchoDebugClearTags()

Clears any tag filter so all tags are allowed.

Returns
Bool
EchoDebugGetTags()

Returns the current allowed tags. An empty array means all tags are allowed. Returns false when Echo is disabled.

Returns
Array<String>|Bool

Enums

eEchoDebugLevel

Controls which messages pass into Echo's normal output and filtered history. Raw capture is separate and can remember messages before this filter is applied.

NONE Nothing passes into normal output or filtered history.
SEVERE_ONLY Only severe messages pass.
COMPREHENSIVE Warnings and severe messages pass. This is the default.
COMPLETE Info, warning, and severe messages pass.
NUM Enum sentinel used internally for validation. Don't use it as a debug level.
eEchoDebugUrgency

Describes how important one message is.

INFO Normal information.
WARNING Something looks wrong, but the game can probably continue.
SEVERE Something is broken enough that you should investigate it immediately.
NUM Enum sentinel used internally for validation. Don't use it as a message urgency.

Macros

Version

Debug setup

ECHO_DEBUG_ENABLED

Compile-time Echo debug on/off switch. When set to 0, public EchoDebug* calls return false. Use EchoDebugSetLevel() when you need to change logging verbosity at runtime.

Default
1

Symbol index