Preview Mode Links will not work in preview mode

ColdFusion Alive


May 30, 2017

Gert Franz talks about “CFML Debugging Jedi Tricks and Templates” in this episode of ColdFusion Alive Podcast with host Michaela Light. He is also one of the speakers at CFObjective Conference.

In this session, we will have a closer look at the debugging templates Lucee and Adobe ColdFusion have aboard. Especially in Lucee, there is a lot of hidden information buried in the depths of the data. You can extract this data and write your own fancy debugging template.

In Lucee this is a simple CFC that contains a few methods which display the data. As a takeaway from the session, you will receive a shiny new debugging template for Lucee which you can extend as you see fit.

Show notes

  • What is a debugging template?
    • The debugging template displays the info that can be optionally displayed at the bottom of every page, containing the formatted debugging information provided by the CFML engine
  • Why use a debugging template?
    • Gives lots of info what has happened in the code, what CFC run, what parts were slow
  • What about security?
    • Limit debugging display to certain IP addresses
    • Don’t turn on in production
    • Be careful about displaying information about your application to the public
  • What is the overhead of turning this feature on?
    • 1-2% overhead in Lucee (in ACF it used to be 50% many years ago)
  • Why write your own?
    • There is tons of additional info in the debugging information which may or may not be displayed by the selected debugging information.
    • You can decorate the data with your own additional info
  • Do I need some special skills to work on the debugging templates?
    • Just a regular CFC
    • Create a configuration struct containing the info you want to have displayed
    • Output method
  • What happens if you have a bug in your debugging template
    • The regular CFML error handler kicks in
  • Lucee debugging handling extra features
    • More granularity by website and IP
    • Has additional information in the debugging
  • Debugging and Performance jedi tricks
    • Rewrite the code as tag or script as appropriate in order to understand it
    • The Code Monkey (wrong) - talk to a plushie and explain your problem, often helps solving the issue yourself. Apparently I used the wrong term. It is rubber duck debugging.

  • Make a copy of the code and ruthlessly cut out pieces until the error doesn’t happen anymore - the last piece you cut is related to the bug
  • Format your code, even your SQL
  • What I learned from the Railo project
    • To be happy and to do what you love
    • To let go the past
  • How can I contribute to Lucee, how can I help?
  • Why should I attend any conference
    • You will be learning many new techniques, meet cool people, get to know who is behind all the magic, network
  • Is it still worth learning Lucee or CFML?
    • You get better rates at freelance jobs
    • It is a very modern language
  • Why are you proud to use CF?
    • Because I helped develop the language and keep it from vanishing
  • WWIT for you to make CF more alive this year?
    • Speak about it, be proud to use it, write your apps with it
  • What are you looking forward to at CFObjective?
    • Meet my friends
    • Great topics and great presenters
    • See the capital again :)

Very often people just stick with the debugging templates that come with either Lucee or ACF. They are nice and helpful, but if one wants way more information, he needs to unlock the potential and extend the existing ones or even write his own new debugging template.

Mentioned in this episode

Listen to the Audio

[tt_fusebox episode="024"]

 

Bio

Gert Franz

Gert was born in 1967 and lives in Switzerland since 1997. He is one of the key people behind Lucee. Back in the late eighties he studied Astrophysics in Munich but switched to later IT as a profession and programmed for several companies in the past as a database administrator and system analyst.

Links