$k. console

Provides functions to print data to the debug console (UI) or standard output (command line tools). The console object is also available for compatibility as global object "console".

Methods

(static) assert(assertion, varargs)

Prints the objects if the assertion is false

Parameters:
NameTypeDescription
assertionboolean

Assertion

varargs

The objects to log

(static) dir(obj)

Prints the properties of the object

Parameters:
NameTypeDescription
obj

The object to print

(static) error(varargs)

Same as log(), with log level ERROR

Parameters:
NameTypeDescription
varargs

The objects to log

(static) info(varargs)

Same as log()

Parameters:
NameTypeDescription
varargs

The objects to log

(static) log(varargs)

Prints the objects to the console with the default log level. Note that string substitution is not supported yet

Parameters:
NameTypeDescription
varargs

The objects to log

(static) time(label)

Starts a named timer

Parameters:
NameTypeDescription
labelstring

The name of the timer

(static) timeEnd(label)

Stops and logs a named timer. If the timer was not started with time(), nothing will be logged

Parameters:
NameTypeDescription
labelstring

The name of the timer.

(static) trace()

Prints a stack trace

(static) warn(varargs)

Same as log(), with log level WARNING

Parameters:
NameTypeDescription
varargs

The objects to log