console
The console
object enables your add-on to log messages. If you have started
the host application for your add-on from the command line (for example, by
executing cfx run
or cfx test
) then these messages appear in the command
shell you used. If the add-on has been installed in the host application, then
the messages appear in the host application's
Error Console.
The console
object has the following methods:
console.log(object[, object, ...])
Logs an informational message to the shell. Depending on the console's underlying implementation and user interface, you may be able to introspect into the properties of non-primitive objects that are logged.
console.info(object[, object, ...])
A synonym for console.log()
.
console.warn(object[, object, ...])
Logs a warning message.
console.error(object[, object, ...])
Logs an error message.
console.debug(object[, object, ...])
Logs a debug message.
console.exception(exception)
Logs the given exception instance as an error, outputting information about the exception's stack traceback if one is available.
console.trace()
Logs a stack trace at the point this function is called.