Console
Write to the script console, in the style of a web browser's console, and measure how long things take. log, info, warn and error print a line; time and timeEnd time a piece of the script; count counts how many times a line runs. Unlike other groups, these command names start lower case, except LogToARC.
Where to find it: type Console. in a Python script, or open the ARCx API view of the script editor and expand Console
Commands
| Command | What it does |
|---|---|
| Console.count | Print how many times this has been called under the given name. |
| Console.error | Raise the text as an error, which stops the script. |
| Console.info | Prints an empty line to the script output. |
| Console.log | Prints an empty line to the script output. |
| Console.LogToARC | Write a line to the ARCx debug log rather than to the script console. |
| Console.time | Start a named timer. |
| Console.timeEnd | Stop a named timer and print how long it ran for. |
| Console.warn | Prints an empty line to the script output. |
Details
Console.count
Print how many times this has been called under the given name.
Console.count()
Console.count(key)
| Value | Type | What it is |
|---|---|---|
key |
str | Optional. The name of the counter. |
Console.error
Raise the text as an error, which stops the script. This mirrors the JavaScript helper, where console.error() also throws rather than merely printing.
Console.error()
Console.error(txt)
| Value | Type | What it is |
|---|---|---|
txt |
str | Optional. The error message. |
Console.info
Prints an empty line to the script output.
Console.info()
Console.info(txt)
| Value | Type | What it is |
|---|---|---|
txt |
str | Optional. The text to print. |
Console.log
Prints an empty line to the script output.
Console.log()
Console.log(txt)
| Value | Type | What it is |
|---|---|---|
txt |
str | Optional. The text to print. |
Console.LogToARC
Write a line to the ARCx debug log rather than to the script console.
Console.LogToARC(txt)
| Value | Type | What it is |
|---|---|---|
txt |
str | The text to log. |
Console.time
Start a named timer. Pass no name to use the unnamed one.
Console.time()
Console.time(key)
| Value | Type | What it is |
|---|---|---|
key |
str | Optional. The name of the timer. |
Console.timeEnd
Stop a named timer and print how long it ran for.
Console.timeEnd()
Console.timeEnd(key)
| Value | Type | What it is |
|---|---|---|
key |
str | Optional. The name of the timer. |
Console.warn
Prints an empty line to the script output.
Console.warn()
Console.warn(txt)
| Value | Type | What it is |
|---|---|---|
txt |
str | Optional. The text to print. |