public class Console extends Object
| Constructor and Description |
|---|
Console() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBreakPoint()
Adds a break point for the debugger.
|
void |
assertTrue(boolean expression,
Object... objects)
Tests that an expression is true.
|
void |
count(String title)
Writes the number of times that the line of code where count was called was executed.
|
void |
debug(Object object,
Object... objects)
Writes a message to the console, including a hyperlink to the line where it was called.
|
void |
dir(Object object)
Prints an interactive listing of all properties of the given object.
|
void |
dirxml(com.google.gwt.dom.client.Node node)
Prints the XML source tree of an HTML or XML element.
|
void |
error(Object object,
Object... objects)
Writes a message to the console with the visual "error" icon and color coding and a hyperlink to the line where
it was called.
|
static Console |
getInstance() |
void |
group(Object object,
Object... objects)
Writes a message to the console and opens a nested block to indent all future messages sent to the console.
|
void |
groupEnd()
Closes the most recently opened block created by a call to
group(Object, Object...). |
void |
info(Object object,
Object... objects)
Writes a message to the console with the visual "info" icon and color coding and a hyperlink to the line where it
was called.
|
void |
log(Object object,
Object... objects)
Writes a message to the console.
|
void |
profile(String title)
Turns on the JavaScript profiler.
|
void |
profileEnd()
Turns off the JavaScript profiler and prints its report.
|
void |
time(String name)
Creates a new timer under the given name.
|
void |
timeEnd(String name)
Stops a timer created by a call to
time(String) and writes the time elapsed. |
void |
trace()
Prints an interactive stack trace of JavaScript execution at the point where it is called.
The stack trace details the functions on the stack, as well as the values that were passed as arguments to each function. |
void |
warn(Object object,
Object... objects)
Writes a message to the console with the visual "warning" icon and color coding and a hyperlink to the line where
it was called.
|
public static Console getInstance()
public void time(String name)
timeEnd(String) with the same name to stop the timer and
print the time elapsed.name - The name of the timer.public void timeEnd(String name)
time(String) and writes the time elapsed.name - The name of the timer.public void profile(String title)
title - The text to be printed in the header of the profile report.public void profileEnd()
public void count(String title)
title - The message printed in addition to the number of the count.public void log(Object object, Object... objects)
console.log("The %s jumped over %d tall buildings", animal, count);console.log("The", animal, "jumped over", count, "tall buildings");console.log("I am %s and I have:", myName, thing1, thing2, thing3);| String | Substitution Patterns |
| %s | String |
| %d, %i | Integer (numeric formatting is not yet supported) |
| %f | Floating point number (numeric formatting is not yet supported) |
| %o | Object hyperlink |
object - First parameter is required. It can be either a formatting string or any ordinary object.objects - Optional parameters.public void debug(Object object, Object... objects)
object - First parameter is required. It can be either a formatting string or any ordinary object.objects - Optional parameters.log(Object, Object...)public void info(Object object, Object... objects)
object - First parameter is required. It can be either a formatting string or any ordinary object.objects - Optional parameters.log(Object, Object...)public void warn(Object object, Object... objects)
object - First parameter is required. It can be either a formatting string or any ordinary object.objects - Optional parameters.log(Object, Object...)public void error(Object object, Object... objects)
object - First parameter is required. It can be either a formatting string or any ordinary object.objects - Optional parameters.log(Object, Object...)public void assertTrue(boolean expression,
Object... objects)
expression - The expression to be evaluated.objects - Optional parameters.log(Object, Object...)public void dir(Object object)
object - The object whose properties will be displayed.public void dirxml(com.google.gwt.dom.client.Node node)
node - Any DOM node.public void trace()
public void group(Object object, Object... objects)
groupEnd() to close the block.object - First parameter is required. It can be either a formatting string or any ordinary object.objects - Optional parameters.log(Object, Object...)public void groupEnd()
group(Object, Object...).public void addBreakPoint()
Copyright © 2004–2015 XWiki. All rights reserved.