The OpenLayers.Console namespace is used for debugging and error logging. If the Firebug Lite (../Firebug/firebug.js) is included before this script, calls to OpenLayers.Console methods will get redirected to window.console. This makes use of the Firebug extension where available and allows for cross-browser debugging Firebug style.
Note that behavior will differ with the Firebug extention and Firebug Lite. Most notably, the Firebug Lite console does not currently allow for hyperlinks to code or for clicking on object to explore their properties.
OpenLayers. | The OpenLayers.Console namespace is used for debugging and error logging. |
Functions | |
log | Log an object in the console. |
debug | Writes a message to the console, including a hyperlink to the line where it was called. |
info | Writes a message to the console with the visual “info” icon and color coding and a hyperlink to the line where it was called. |
warn | Writes a message to the console with the visual “warning” icon and color coding and a hyperlink to the line where it was called. |
error | Writes a message to the console with the visual “error” icon and color coding and a hyperlink to the line where it was called. |
userError | A single interface for showing error messages to the user. |
assert | Tests that an expression is true. |
dir | Prints an interactive listing of all properties of the object. |
dirxml | Prints the XML source tree of an HTML or XML element. |
trace | Prints an interactive stack trace of JavaScript execution at the point where it is called. |
group | Writes a message to the console and opens a nested block to indent all future messages sent to the console. |
groupEnd | Closes the most recently opened block created by a call to OpenLayers.Console.group |
time | Creates a new timer under the given name. |
timeEnd | Stops a timer created by a call to OpenLayers.Console.time(name) and writes the time elapsed. |
profile | Turns on the JavaScript profiler. |
profileEnd | Turns off the JavaScript profiler and prints its report. |
count | Writes the number of times that the line of code where count was called was executed. |
log: function()
Log an object in the console. The Firebug Lite console logs string representation of objects. Given multiple arguments, they will be cast to strings and logged with a space delimiter. If the first argument is a string with printf-like formatting, subsequent arguments will be used in string substitution. Any additional arguments (beyond the number substituted in a format string) will be appended in a space- delimited line.
object | {Object} |
trace: function()
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. You can click each function to take you to its source in the Script tab, and click each argument value to inspect it in the DOM or HTML tabs.
count: function()
Writes the number of times that the line of code where count was called was executed. The optional argument title will print a message in addition to the number of the count.
This function is not currently implemented in Firebug Lite.
title | {String} Optional title to be printed with count |
Log an object in the console.
log: function()
Writes a message to the console, including a hyperlink to the line where it was called.
debug: function()
Writes a message to the console with the visual “info” icon and color coding and a hyperlink to the line where it was called.
info: function()
Writes a message to the console with the visual “warning” icon and color coding and a hyperlink to the line where it was called.
warn: function()
Writes a message to the console with the visual “error” icon and color coding and a hyperlink to the line where it was called.
error: function()
A single interface for showing error messages to the user.
userError: function( error )
Tests that an expression is true.
assert: function()
Prints an interactive listing of all properties of the object.
dir: function()
Prints the XML source tree of an HTML or XML element.
dirxml: function()
Prints an interactive stack trace of JavaScript execution at the point where it is called.
trace: function()
Writes a message to the console and opens a nested block to indent all future messages sent to the console.
group: function()
Closes the most recently opened block created by a call to OpenLayers.Console.group
groupEnd: function()
Creates a new timer under the given name.
time: function()
Stops a timer created by a call to OpenLayers.Console.time(name) and writes the time elapsed.
timeEnd: function()
Turns on the JavaScript profiler.
profile: function()
Turns off the JavaScript profiler and prints its report.
profileEnd: function()
Writes the number of times that the line of code where count was called was executed.
count: function()