FBTrace
From FirebugWiki
Sebastianz (Talk | contribs) m (Fixed formatting and spelling) |
|||
| (7 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
[[Image:FBTrace.png|thumb|400px|FBTrace]] | [[Image:FBTrace.png|thumb|400px|FBTrace]] | ||
The ''Firebug Tracing Console'' (short FBTrace) is used for debugging Firebug and [[Firebug Extensions|Firebug extensions]]. It logs all Firebug activities and thereby helps tracking down errors inside the source code. | The ''Firebug Tracing Console'' (short FBTrace) is used for debugging Firebug and [[Firebug Extensions|Firebug extensions]]. It logs all Firebug activities and thereby helps tracking down errors inside the source code. | ||
| + | |||
| + | == Firebug Versions == | ||
| + | First of all see how the Tracing Console works with different Firebug versions. | ||
| + | |||
| + | * Any Firebug release with 'X' in the label e.g. 1.7X has the Trace Console (aka FBTrace) built in. | ||
| + | * For the final releases up to Firebug 1.7 (without 'X') you need to install a simple extension that brings back the menu item. | ||
| + | * The Tracing Console is entirely removed from Firebug core since 1.8a1. We are not planning to release 'X' versions anymore. You need to install the FBTrace extension in order to have the console. | ||
== Installation == | == Installation == | ||
| - | Until Firebug 1.7 FBTrace was bundled together with its alpha and beta versions. To be able to inspect the logs even in the case Firebug is broken (e. g. it doesn't even load itself) and to make the release process easier for Firebug 1.8 FBTrace was extracted from the Firebug source and is now available as an independent extension. For more information about this step please read the [http://groups.google.com/group/firebug-working-group/browse_thread/thread/6e2c2ca5e4b6cf26 news group thread about FBTrace] as well as the [http://blog.getfirebug.com/2011/04/01/firebug-1-8a1/ blog entry to Firebug 1.8a1]. | + | Until Firebug 1.7 FBTrace was bundled together with its alpha and beta versions. To be able to inspect the logs even in the case Firebug is broken (e. g. it doesn't even load itself) and to make the release process easier for Firebug 1.8+ FBTrace was extracted from the Firebug source and is now available as an independent extension. For more information about this step please read the [http://groups.google.com/group/firebug-working-group/browse_thread/thread/6e2c2ca5e4b6cf26 news group thread about FBTrace] as well as the [http://blog.getfirebug.com/2011/04/01/firebug-1-8a1/ blog entry to Firebug 1.8a1]. |
=== From XPI === | === From XPI === | ||
| - | The simplest way how to install FBTrace extension is to use an XPI we regularly build from the source. Check [http://getfirebug.com/releases/fbtrace | + | The simplest way how to install the FBTrace extension is to use an XPI we regularly build from the source. Check the [http://getfirebug.com/releases/fbtrace/ releases] directory for the latest version. |
=== From Source === | === From Source === | ||
| - | You can get the [http://code.google.com/p/fbug/source/browse/#svn/extensions/fbtrace/branches/ | + | You can get the [http://code.google.com/p/fbug/source/browse/#svn/extensions/fbtrace/branches/ FBTrace source] using a Subversion client. To install FBTrace please follow the description of [[Simple Firebug build|building Firebug from source]] or place a file named <code>fbtrace@getfirebug.com</code> containing the path to the source code in your Firefox profile directory (for more info on how to do this please read the [https://developer.mozilla.org/en/Setting_up_extension_development_environment#Firefox_extension_proxy_file steps to create a Firefox extension proxy file]). |
== How to open the console == | == How to open the console == | ||
| - | After you installed FBTrace you have following possibilities to start it: | + | After you installed FBTrace you have the following possibilities to start it: |
=== Firebug === | === Firebug === | ||
| - | Firebug allows opening of the | + | Firebug allows opening of the Tracing Console from the [[Firebug Menu]] |
| - | * Firebug | + | * Firebug Menu > Open Firebug Tracing |
| - | * Firebug | + | * Firebug Menu > Options > Always Open Firebug Tracing |
[[Image:Trace-console.png]] | [[Image:Trace-console.png]] | ||
| + | |||
| + | If you want to open the console for Firebug automatically after restart you need to set following preference to true: | ||
| + | |||
| + | <code>extensions.firebug.alwaysOpenTraceConsole</code> | ||
=== Chromebug === | === Chromebug === | ||
| - | * [[Chromebug]] Tools | + | * [[Chromebug]] Tools > Open Chromebug Tracing Console |
[[File:Trace-console-chromebug.png]] | [[File:Trace-console-chromebug.png]] | ||
| + | |||
| + | If you want to open the console for Chromebug automatically after restart you need to set following preference to true: | ||
| + | |||
| + | <code>extensions.chromebug.alwaysOpenTraceConsole</code> | ||
| + | |||
| + | == Tracing from your own extension == | ||
| + | You can use the console also from your own extension - Firebug doesn't even need to be installed. All you need is the [http://getfirebug.com/releases/fbtrace/ FBTrace extension]. | ||
| + | |||
| + | * Your extension should create a new preference: | ||
| + | |||
| + | <source lang="javascript"> | ||
| + | pref("extensions.firebug.DBG_MYEXT", false); | ||
| + | </source> | ||
| + | |||
| + | * <code>extensions.firebug.DBG_</code> prefix is mandatory. | ||
| + | |||
| + | * As soon as the preference exists you should see a new option <code>MYEXT</code> in the Tracing Console. | ||
| + | |||
| + | * Get the tracing service in your code. | ||
| + | <source lang="javascript"> | ||
| + | Components.utils.import("resource://firebug/firebug-trace-service.js"); | ||
| + | var FBTrace = traceConsoleService.getTracer("extensions.firebug"); | ||
| + | </source> | ||
| + | |||
| + | ... and create a log: | ||
| + | |||
| + | <source lang="javascript"> | ||
| + | if (FBTrace.DBG_MYEXT) | ||
| + | FBTrace.sysout(string, object); | ||
| + | </source> | ||
| + | |||
| + | == Options tab == | ||
| + | You can control what is logged using the Options tab. The list of options is shown at the [[Firebug_Preferences#FBTrace_preferences|FBTrace preferences]]. Look for them in the Options tab without the *DBG_* prefix. | ||
| + | Some of the main options are: | ||
| + | * To see main errors: ERRORS | ||
| + | * For problems with breakpoints: UI_LOOP, BP, SOURCEFILES | ||
| + | * For problems with Console: CONSOLE, ACTIVATION | ||
| + | * For problems where Firebug UI is acting weird: DISPATCH, ACTIVATION, PANELS | ||
| + | |||
| + | == Logging to OS Console == | ||
| + | For crashes or hangs where you can't use FBTrace, run the Firefox Console with this <code>about:config</code> preference set to true: | ||
| + | |||
| + | <code>extensions.firebug-tracing-service.DBG_toOSConsole</code> | ||
| + | |||
| + | == Background and more info == | ||
| + | More details on FBTrace are given at [http://www.softwareishard.com/blog/firebug/fbtrace-console/ Honza's blog], anything in this wiki page supersedes that original blog post. | ||
Latest revision as of 21:40, 17 September 2011
The Firebug Tracing Console (short FBTrace) is used for debugging Firebug and Firebug extensions. It logs all Firebug activities and thereby helps tracking down errors inside the source code.
Contents |
[edit] Firebug Versions
First of all see how the Tracing Console works with different Firebug versions.
- Any Firebug release with 'X' in the label e.g. 1.7X has the Trace Console (aka FBTrace) built in.
- For the final releases up to Firebug 1.7 (without 'X') you need to install a simple extension that brings back the menu item.
- The Tracing Console is entirely removed from Firebug core since 1.8a1. We are not planning to release 'X' versions anymore. You need to install the FBTrace extension in order to have the console.
[edit] Installation
Until Firebug 1.7 FBTrace was bundled together with its alpha and beta versions. To be able to inspect the logs even in the case Firebug is broken (e. g. it doesn't even load itself) and to make the release process easier for Firebug 1.8+ FBTrace was extracted from the Firebug source and is now available as an independent extension. For more information about this step please read the news group thread about FBTrace as well as the blog entry to Firebug 1.8a1.
[edit] From XPI
The simplest way how to install the FBTrace extension is to use an XPI we regularly build from the source. Check the releases directory for the latest version.
[edit] From Source
You can get the FBTrace source using a Subversion client. To install FBTrace please follow the description of building Firebug from source or place a file named fbtrace@getfirebug.com containing the path to the source code in your Firefox profile directory (for more info on how to do this please read the steps to create a Firefox extension proxy file).
[edit] How to open the console
After you installed FBTrace you have the following possibilities to start it:
[edit] Firebug
Firebug allows opening of the Tracing Console from the Firebug Menu
- Firebug Menu > Open Firebug Tracing
- Firebug Menu > Options > Always Open Firebug Tracing
If you want to open the console for Firebug automatically after restart you need to set following preference to true:
extensions.firebug.alwaysOpenTraceConsole
[edit] Chromebug
- Chromebug Tools > Open Chromebug Tracing Console
If you want to open the console for Chromebug automatically after restart you need to set following preference to true:
extensions.chromebug.alwaysOpenTraceConsole
[edit] Tracing from your own extension
You can use the console also from your own extension - Firebug doesn't even need to be installed. All you need is the FBTrace extension.
- Your extension should create a new preference:
pref("extensions.firebug.DBG_MYEXT", false);
-
extensions.firebug.DBG_prefix is mandatory.
- As soon as the preference exists you should see a new option
MYEXTin the Tracing Console.
- Get the tracing service in your code.
Components.utils.import("resource://firebug/firebug-trace-service.js"); var FBTrace = traceConsoleService.getTracer("extensions.firebug");
... and create a log:
if (FBTrace.DBG_MYEXT) FBTrace.sysout(string, object);
[edit] Options tab
You can control what is logged using the Options tab. The list of options is shown at the FBTrace preferences. Look for them in the Options tab without the *DBG_* prefix. Some of the main options are:
- To see main errors: ERRORS
- For problems with breakpoints: UI_LOOP, BP, SOURCEFILES
- For problems with Console: CONSOLE, ACTIVATION
- For problems where Firebug UI is acting weird: DISPATCH, ACTIVATION, PANELS
[edit] Logging to OS Console
For crashes or hangs where you can't use FBTrace, run the Firefox Console with this about:config preference set to true:
extensions.firebug-tracing-service.DBG_toOSConsole
[edit] Background and more info
More details on FBTrace are given at Honza's blog, anything in this wiki page supersedes that original blog post.

