This page is no longer updated

We've left it here for reference. Find Out More.

PlanetHITOP

Debugging.

The other day whilst tidying up some templates, I found a bug in Hitop 0.36. The cause was a bit of code like this:

<@get name="name:replace('',' ')">

What the code should have been was:

<@get name="name:replace(' ',' ')">

Note the space between the single quotes. Unfortunatly the former told Hitoplive to replace everything with &nbsp;'s, which, after some time, caused everything to crash nastily. It was litterally soaking up memory like no ones business.

It was a silly mistake in my code, but it shouldn't occur once Hitop 0.37 arrives on the scene. However it did introduce me to the world of Hitop debugging.

Basic Debugging.

Hitoplive always adds any problems it encounters, in a comment at the bottom of the file, and this should always be consulted first.

For Hitop users, the same errors are outputted to the standard error on the command line instead.

Next Step with Hitoplive.

If you're using Hitoplive and you hit a major problem, one of the first things you can do is run the file through hitop on the command line. If you, for example, want to debug a file radio/index.live, run hitop from your site root directory as follows:

hitop radio/index.live radio/index.html

Don't forget that this file probably won't appear in your navigation file, so some of your @NAV commands may not get processed. To solve that, simply add the file to your .nav file for the time being.

Hitop will then output the errors to the standard error of your terminal.

Advanced Debugging.

One of the most comprehensive ways to debug is to use @HITOP. By calling on the debug attribute, you can get a line by line output of Hitop or Hitoplive's actions, until it ends. To use it, add <@hitop debug="10"> to the top of your main template file.

Hitop/Hitoplive will then put a line by line echo of every command it processes. Of course if you normally use Hitoplive, you can process the page through Hitop and write the output in the file by:

hitop path/to/file.live path/to/file.html 2>debug.txt

ensuring that you change your .nav file as appropiate.

Beware!

Of course, if you're using Hitoplive do remember to remove <@hitop debug="10"> before putting your site accessible to the public, as the debug code will add a huge amount to the page weight of your files. A slower download will of course annoy your users!


top^

Planet Bods NetworkSites in the network