Log

Log controls what is written to the console, and also routes those messages to the Editor's console. Using these methods instead of console.log will let the message show up in the Editor.

Properties

static messages Array

The list of messages that have been logged.

static onClear Signal

Called when the log has been cleared.

static onCodeError Signal

Emitted when a code error message has been logged.

static onMessage Signal

Emitted when a message has been logged.

Methods

static alert(…msg)

Present an Alert modal dialog with the given message

Parameters
msg* *

message data to write

static assert(condition, text)

If condition is false, log the message and present an alert message.

Parameters
condition bool
text String

static clear()

Clear the logged messages.

static codeError(error, line, resource, extra)

Print error code and emit an event so it can be traced.

Parameters
error String
line number
resource String
extra *

static debug(…msg)

Log a message with an Debug tag.

Parameters
msg* *

message data to write

static error(…msg)

Log a message with an Error tag.

Parameters
msg* *

message data to write

static info(…msg)

Log a message with an Info tag.

Parameters
msg* *

message data to write

static messageToString(args) → String

Convert message data, either a string or anything that JSON can stringify, to a string.

Parameters
args *

message data to convert

Returns
String

static warning(…msg)

Log a message with an Warning tag.

Parameters
msg* *

message data to write

static write(…msg)

Log a message directly.

Parameters
msg* *

message data to write