|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.user.client.Console
public class Console
Interface to the browser's console. Useful for logging and profiling. This class provides an empty implementation. Each browser has its own console API. You should extend this class and overwrite the needed methods by using that API.
| Constructor Summary | |
|---|---|
Console()
|
|
| Method Summary | |
|---|---|
void |
addBreakPoint()
Adds a break point for the debugger. |
void |
assertTrue(boolean expression,
java.lang.Object... objects)
Tests that an expression is true. |
void |
count(java.lang.String title)
Writes the number of times that the line of code where count was called was executed. |
void |
debug(java.lang.Object object,
java.lang.Object... objects)
Writes a message to the console, including a hyperlink to the line where it was called. |
void |
dir(java.lang.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(java.lang.Object object,
java.lang.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(java.lang.Object object,
java.lang.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(java.lang.Object object,
java.lang.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(java.lang.Object object,
java.lang.Object... objects)
Writes a message to the console. |
void |
profile(java.lang.String title)
Turns on the JavaScript profiler. |
void |
profileEnd()
Turns off the JavaScript profiler and prints its report. |
void |
time(java.lang.String name)
Creates a new timer under the given name. |
void |
timeEnd(java.lang.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(java.lang.Object object,
java.lang.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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Console()
| Method Detail |
|---|
public static Console getInstance()
public void time(java.lang.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(java.lang.String name)
time(String) and writes the time elapsed.
name - The name of the timer.public void profile(java.lang.String title)
title - The text to be printed in the header of the profile report.public void profileEnd()
public void count(java.lang.String title)
title - The message printed in addition to the number of the count.
public void log(java.lang.Object object,
java.lang.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(java.lang.Object object,
java.lang.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(java.lang.Object object,
java.lang.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(java.lang.Object object,
java.lang.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(java.lang.Object object,
java.lang.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,
java.lang.Object... objects)
expression - The expression to be evaluated.objects - Optional parameters.log(Object, Object...)public void dir(java.lang.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(java.lang.Object object,
java.lang.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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||