Monday, February 22, 2010

tl_debug: An useful extension for debugging TYPOlight

Project:  http://www.cyberspectrum.de/

Project webSvn page: (http://websvn.cyberspectrum.de/wsvn/tl_debug/)

tl_debug enable using firePhp from inside your TYPOlight extension.

Installation

You can download the source through svn.

At this time the most recent version is available doing a checkout at http://websvn.cyberspectrum.de/wsvn/tl_debug/tags/0.5.0

If you are not familiar with svn you can use tools like TortoiseSVN  (http://tortoisesvn.net/downloads)

debugger_be_link

Once downloaded the source you must copy the directory contained in system/modules (z___debug and debug) to your system/modules installation (i.e. TL_ROOT/system/modules/). Then a “developers” section appears to backend menu: click on “Debugger” to open the tl_debug settings panel.

 

In order to display the log messages you need the Firebug add on for Firefox (at least version 1.5.0 http://getfirebug.com/releases/firebug/1.5X/) and the firePHP plugin for FireBug https://addons.mozilla.org/en-US/firefox/addon/6149

Usage

Be sure to enable the debug in the backend module (Debugger) and set the options related to error level and database query you wish to log. You can log hooks on database queries coming from specific modules. It is a great tool.

Usage is simple as adding these lines where you need to debug:

/**
* $channel is one of ('log', 'info', 'error', 'warn')
* $label is a custom label
* $message is the message you want to show
*/
if ($GLOBALS['TL_CONFIG']['debugMode'])
$GLOBALS['TL_DEBUG'][$channel][$label] = $message;



This is the results on message logged with channel ‘log’ label ‘Hello’ and message ‘World!’;




i.e.




if ($GLOBALS['TL_CONFIG']['debugMode'])
$GLOBALS['TL_DEBUG']['log']['hello']= 'world!';



 




debugger_firebug




 




I hope you enjoy it!




thank you to qrczak for letting me know this project.

1 comment:

  1. Hi there,
    I'm glad that you find it already useful.
    Currently it is in early beta state. When you find bugs please let me know.

    Regards from Germany
    Chris (the author of tl_debug)

    ReplyDelete