# OpenLayers Debug Example

# Debug Example

debugging, error, fix, fixing, console, firebug, developers, advanced

Demonstrate console calls to a Firebug console. Requires Firefox. Mostly for developers.

To run OpenLayers in debug mode, include the following script tag before the tag that loads OpenLayers:

        <script src="../lib/Firebug/firebug.js"></script>

The path to firebug.js must be relative to your html file. With this script included calls to OpenLayers.Console will be displayed in the Firebug console. For browsers without the Firebug extension, the script creates a Firebug Lite console. This console can be opened by hitting F12 or Ctrl+Shift+L (Command+Shift+L on a Mac). If you want the Firebug Lite console to be open when the page loads, add debug="true" to the opening html tag of your page. Open the console and click on the links below to see console calls.

- OpenLayers.Console.log()
- OpenLayers.Console.warn()
- OpenLayers.Console.error()
- OpenLayers.Console.dir()
- OpenLayers.Console.dirxml()

The Firebug website has a complete list of console calls. Note that not all are supported with Firebug Lite.