Debug Toolbar

  • Tags: debug, toolbar
  • Latest: 0.1
  • Last Updated: 12 December 2009
  • Grails version: 1.1.1 > *
  • Authors: null
0 vote
Dependency:
compile ":debug-toolbar:0.1"

 Documentation

Summary

Installation

grails install-plugin debug-toolbar

Description

Grails Debug Toolbar is a plugin inspired from Django Debug Toolbar created Rod Hudson (http://robhudson.github.com/django-debug-toolbar/).

This plugin provides an easy way of including the debugging capability for the requests made to your web application.

After installing the plugin you need to add a custom tag provided by plugin to your pages (better way is always to add it your layout file).

<body>
        <div id="spinner" class="spinner" style="display:none;">
            <img src="${resource(dir:'images',file:'spinner.gif')}" alt="Spinner" />
        </div>	
        <div class="logo"><img src="${resource(dir:'images',file:'grails_logo.jpg')}" alt="Grails" /></div>
        <g:layoutBody />

<debugToolbar:renderMe/>

</body>

The custom tag <debugToolbar:renderMe/> will only render elements when either

  • You are in development mode or,
  • You have explicitly enabled its use by providing a config option
debugToolbar.enabled = true

As of version 0.1 of this plugin there are debug panels for

  • Versions - It display version of grails, application, java and installed plugins
  • HTTP Headers - The HTTP headers passed in your request
  • Request Variables - Cookies, Session, and Request
  • Config - Your configuration options
You can extend the tool bar by providing a debugging panel from with in your application. The plugin provides a command to create your own artefacts:

grails create-debug-panel Some

Above command line will create grails-app/panels/SomeDebugPanel.groovy which you can update to render your own debugging information. Your panel will automatically become part of tool bar.

Future work

  • Currently the views of debugtoolbar need to go in the grails-app/views of the application. When you install the plugin they are automatically copied to your application grails-app/views. Need to avoid this.
  • JavaScript and static resources for the toolbar reside in web-app/debugtoolbar. It is also copied to your application web-app/debugtoolbar. Need to avoid this.
  • A way of ordering the panels in the toolbar. Currently it is random depending on how beans are found during execution of tag.
  • More useful panels such as Timing the requests, SQL queries, logging etc