[OpenLayers-Trac] [OpenLayers] #507: debug mode
OpenLayers
trac at openlayers.org
Sun Apr 1 12:27:12 EDT 2007
#507: debug mode
----------------------+-----------------------------------------------------
Reporter: tschaub | Owner: tschaub
Type: feature | Status: new
Priority: minor | Milestone: 2.5 Release
Component: tests | Version:
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Comment (by tschaub):
Ok, ignore most of the above. I'm attaching a new patch that I consider a
very unobtrusive debugging option. It works like this:
1) developers put calls to OpenLayers.console.warn(),
OpenLayers.console.error(), or any number of other console methods in the
code where appropriate
2) users who are having trouble with their applications add the following
tag after the OpenLayers.js tag
{{{
<script src="../lib/Firebug/DebugOpenLayers.js"></script>
}}}
3) with the debugging script included, hitting F12, Ctrl+Shift+L (or
?+Shift+L on a Mac) opens a debugging console - Firebug on browsers with
the Firebug extension and Firebug Lite on all other browsers
4) that's it - without the debugging script tag, the OpenLayers.console.*
calls are harmless
This adds nothing (significant) to the OpenLayers build. Also, if there
is a reason not to distribute Firebug Lite with the library, the debugging
script tag can point to a script hosted anywhere (on OpenLayers.org for
example).
Example:
[http://dev.openlayers.org/sandbox/tschaub/debug/examples/debug.html
examples/debug.html]
Tests in
[http://dev.openlayers.org/sandbox/tschaub/debug/tests/BaseTypes/test_Console.html
tests/BaseTypes/test_Console.html]. The only real diff in
[http://dev.openlayers.org/sandbox/tschaub/debug/lib/OpenLayers/BaseTypes.js
lib/OpenLayers/BaseTypes.js]. What does the trick?
[http://dev.openlayers.org/sandbox/tschaub/debug/lib/Firebug/DebugOpenLayers.js
lib/Firebug/DebugOpenLayers.js].
--
Ticket URL: <http://trac.openlayers.org/ticket/507#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list