echo
For development and debug purposes. A string that will be saved in the console log. Note: the displayed output in the dev log is capped at 4000 characters per message. The log file will contain the complete output.
Syntax
echo(message)
Returns
returns (integer) true if successful
Parameters
- message (string)
- this message will be timestamped
Usage
The code
function writes a message to the console log window.
The console is shown at the bottom of the Magnetron.dev environment and is useful for testing and debugging purposes.
![console log](http://magnetron.dev/media/pages/syntax/appinteraction/echo/07ce3f378d-1712920503/console_log.png)
The function expects a string. Other variables should first be converted.
for example:
// Person is an object
var person = { firstName:"John", lastName:"Doe" };
// Convert objectToString and echo
echo( objectToString(person) );
This will show the following in the console log
// Returns
17 Oct 2021 12:13:57 {
"firstName": "John",
"lastName": "Doe"
}
message