DebugLogger 0.1
What is this?This is a developer extension for firefox & thunderbird that provides a better alternative to using the dump statment. It breaks up debug statements to be unique per extension or project and let's you view them independantly in a clean colsole
How do I use it?Start by putting debug statments within your extension using this API, like below:
Now fire up your Firefox or Thunderbird, click Tools > Debug Logger and trip this debug statment in your extension. You should see 'Hello World' pop up in the console.
Code Breakdown
Line 1
Get the DebugLogger service
Line 2
Register your app with the logger (a logger object is returned). The name you provide should be unique and specific to your app.
Line 3
Send the debug message "Hello World" at a debug level of 3. The debug level is very important, it helps you mask certain
debug statments from the consol; where 1 is most generic and 5 is the most specific. In the console you can choose what level
of debug statments to watch by selecting the level from the drop-down menu.
Click Tools > Debug Logger to open the colsole.
- Select what app you want to watch by selecting it's name from the first drop-down menu
-
Limit the level of debug statments by selecting a number from the second drop-down menu
(5 shows all messages, 1 shows only the broadest messages)
- The Clear button empties all the log messages for the selected project (loggers)
- The Clear All button empties log message for all projects (loggers)
- Pause will stop collecting log messages from all projects (loggers)
-
Options let's you set the maximum log buffer size.
The loggers will only save up to a certain number of log messages, this
dialog will let you turn that up or down.
-
When you click on a row (or ctrl-click, shift-click for many rows) you can copy it/them by pressing ctrl-C
Special Hints and Tips
In order to prevent errors when somebody runs your extension without the debug logger installed, you should construct a custom wrapper function that will envoke the logger. This way it can be turned off from a single source between development and production.
When a user reports a problem with your extension, you can have them install the DebugLogger so they can provide you with important debugging data to save you lot's of time.
- v 0.1
- 05/05/2005
-
- Launched
