环境
环境 is a global object that is always available in all scripts. It contains some basic functions, which are detailed 下方. To access the global 环境 object, use the global variable env. This variable is always available, automatically, in all scripts.
方法
log(p1, ....., pn) The log() function allows writing information to the log window. The log window is only available when a script is executed in test mode. When the script runs in its normal form (outside of test mode), this function is ignored.
参数
- p1..pn (any quantity and type): The log function can receive any number of parameters, of any type. The text sent to the log console is the concatenation of all parameters passed.
示例
此示例 shows a numeric value in the log console.
env.log('Value: ', 25);此示例 shows a fixed text and a variable in the log console, to display a device address.
env.log('Device address: ', myDevice.address);