Friday, January 4, 2008

Turning on the Debug File

Net Usage creates a debug file (netusage_debug.txt) whenever an error occurs. When you are trying to create your own ISP script you will want the debug file on all the time. This allows you to check variables, parsing commands and other useful information, even when the script works correctly.

To turn on the debug file follow these steps:
  1. In the address field in Firefox enter about:config and hit Enter.
  2. In the filter box type netusage and hit Enter.
  3. You should see a few lines starting with extensions.netusage.0...
    The 0 in the preference name corresponds to the number of Net Usage meters you have in your browser. For example, if you only have 1 meter you will see preferences starting with extensions.netusage.0. If you have 2 meters you will see preferences with extensions.netusage.0 and extensions.netusage.1 and so on. I will assume you only have one meter in your browser.
  4. Add a new preference to the list by right clicking somewhere in the window and selecting New -> Boolean from the pop up menu. In the dialog enter extensions.netusage.0.debug as the Preference Name. and click OK. Then select True for the preference Value and click OK.
  5. Click on the Show All button on the filter line, then enter netusage in the filter field and hit enter. You should now have a new preference of extensions.netusage.0.debug set to True.
Now every time Netusage retrieves the statistics from the ISP's usage page it will write a debug file called netusage_debug.txt in %AppData%\Mozilla\firefox\Profiles\{Your Profile Directory}. When you have finished with the debug files you can turn them off by going back to the about:config page in Firefox and changing the value we just created to False.

If you need more information on the debug file, have a read of this blog post.

No comments: