Subscribe to RSS Feed

There are many Firebug extensions implementing new nifty features for Firebug and its great to see that new ones are still coming.

In this post, we'll take a quick look at one of them: Console Export.

ConsoleExport is a Firebug extension (you need Firebug 1.6+) that allows exporting logs from the Console panel. The export can be done manually through an Export button (see the screenshot below) or automatically by sending every log to the server.


Here is the UI that appears in Firebug after ConsoleExport is installed in your Firefox.


A few links:

  • ConsoleExport home page
  • You can download ConsoleExport from here
  • You can report an issue or suggest new feature here

Auto Export Every Console Log

Since most of the details about manual export is already available on the home page let's focus on auto-export where all logs are sent to the server as XML packets.


Step1: Activate auto-export
There are two ways how to activate/deactivate auto-export. You can use Firebug UI and click the little circle next to the Export button.


In case of automated scenarios (e.g. when Selenium is integrated) you can just set a preference (this is essentially what the button does). [boolean, default=false]


Step2: Handle XML packets on the server
Now you need to specify server URL where to send the logs (XML packets). This is done through another preference.

extensions.firebug.consoleexport.serverURL [string, default=""]

Here is an example server side script (PHP) that receives XML packets and stores them into consoleexport.log file.

  $filename = 'consoleexport.log';

  if (!$handle = fopen($filename, 'a'))
    echo 'File "'.$filename.'" could not be opened';

  $content = file_get_contents('php://input');
  $content .= "\n";

  if (!fwrite($handle, $content))
    echo 'Can\'t write into file "'.$filename.'"';

  echo 'Done!';

Here is an online page that generates some console logs (using console.* API)

And here is an example server side log:

  <msg>an assert</msg>
  <msg>ReferenceError: doesnotexist is not defined</msg>


You can also read detailed packet description.


Rss Commenti

No comments yet

No comments yet.

Sorry, the comment form is closed at this time.