public
Description: Python logging console for Firebug
Homepage: http://firepython.binaryage.com
Clone URL: git://github.com/darwin/firepython.git
name age message
file .gitignore Fri Nov 28 05:45:06 -0800 2008 removed addon part, firepython project should c... [darwin]
file __init__.py Sun Mar 29 03:46:19 -0700 2009 version bump to 0.4 [darwin]
file gprof2dot.py Sat Mar 28 01:16:06 -0700 2009 Added gprof2dot.py to firepython distro [bslatkin]
file handlers.py Sun Mar 29 14:24:19 -0700 2009 code cleanup [Alexander Solovyov]
directory jsonpickle/ Sun Mar 15 19:22:41 -0700 2009 much better performance, fixed jsonpickle to no... [darwin]
file license.txt Sun Jul 26 15:35:55 -0700 2009 reworked package layout to be more 'pythonic', ... [meatballhat]
file middleware.py Mon Mar 30 02:06:44 -0700 2009 profiling support for Django middleware [Alexander Solovyov]
file rakefile Mon Mar 30 05:53:35 -0700 2009 added gprof2dot.py into pypi package [darwin]
file readme.md Mon Mar 30 05:40:24 -0700 2009 updated readme for 0.4 release [darwin]
file setup.py Mon Mar 30 05:49:55 -0700 2009 changed status from alpha to beta [darwin]
file utils.py Sun Mar 29 14:24:19 -0700 2009 code cleanup [Alexander Solovyov]
readme.md

FirePython

FirePython is a sexy Python logger console integrated into Firebug.

Originally, I have created it to light up my lonely nights I was spending with Google App Engine.

Prerequisites

You definitely need Firebug 1.2 or higher. You also have to install Firefox Addon which is called FireLogger.

Easy Installation

Firefox Addon

Preferred way is to install this firefox extension via addons.mozilla.com.

Python Library

sudo easy_install firepython

Install latest version from sources (preferred)

Firefox Addon

If you want to install latest addon from sources, you need to build it. It should be simple, but make sure you have these tools on your paths:

  • git
  • zip
  • ruby and rake

Build steps:

git clone git://github.com/darwin/firelogger.git
cd firelogger
rake

After that your XPI should be available in build/firelogger-X.Y.xpi.

You should be able to install XPI file into Firefox: File -> Open File ... and browse for firelogger-X.Y.xpi.

Remember, that you should be also using latest FirePython library on server-side (see next section).

Python Library

Just note, that it depends on simplejson (or some other json parsing library needed by jsonpickle).

Clone project from github in your project directory.

Or if your web project uses git for versioning, you may want to be cool and use firepython as a submodule of your git repository.

git submodule add git://github.com/darwin/firepython.git relative/path/to/firepython

Note: replace last parameter with relative path in your repo.

In case firepython directory is not on your import paths, you need to add relative/path/to folder into your sys.path.

Usage

Django

After installation, enable middleware by adding its path in MIDDLEWARE_CLASSES: firepython.middleware.FirePythonDjango.

WSGI compatible

After installation, enable middleware firepython.middleware.FirePythonWSGI.

Custom usage

Look for inspiration in middleware.py

Real world examples

Current State

Unfortunately FireLogger is broken with Firebug1.4 branch. Mainly because of changes around Simplified Activation and API changes. Expect FireLogger 0.5 to no longer work with Firebug 1.3 and lower.

  • Version 0.4 works with:
    • Firebug 1.3 + Firefox 3.1
    • Firebug 1.2.1 + Firefox 3.0.4.
    • does not work with Firebug 1.4 alpha!
  • Version 0.3 works with:
    • Firebug 1.3 + Firefox 3.1
    • Firebug 1.2.1 + Firefox 3.0.4.
  • Version 0.2 is tested to work with alpha Firebug 1.3 and Firefox 3.1.

Contributors

Also thanks to

Support

FAQ

How can I open preferences?

Switch to Logger panel and look to Firebug's toolbar. There is a green bug icon. It is a menu button!


Clicking on source-file links in Logger panel does nothing. How can I open trace-back sources in TextMate?

Go to Firebug Menu -> Open With Editor -> Configure editors ... like this: TextMate hint

I was unable to download/install FireLogger extension from addons.mozilla.org. Can you package latest version for me?

Some people reported this problem too. You may try workaround.

How can I see Python profiling graph?

  1. enable this feature in FireLogger preferences
  2. setup a editor in External Editors in Firebug called "Graphviz" (the name is important!). It should be path to executable of a viewer for .dot graphs.
  3. reload page and you should see info log line containing profiling info, clicking on the line launches configured Graphviz viewer (a filename will be passed as the first parameter)



Bugs / Feature requests

The support forum is here.

IRC

IRC channel #firelogger at freenode

Articles

History

  • v0.4 (30.03.2009)

    • [bslatkin] profiling graphs for Python (WSGI)
    • [piranha] enabled profiling support for Django
    • [piranha] PEP-8 code cleanup
  • v0.3 (16.03.2009)

    • [darwin] compatibility with Firebug 1.2
    • [darwin] password protection for production site
    • [darwin] path rewrite functionality
    • [darwin] console supports rich formatting of python log messages
    • [oxyum+piranha] thread-safety
    • [darwin] improved API
    • [darwin] Firefox Addon detached as a separate project FireLogger
    • [darwin] option for hiding internal reprs of exported objects
  • v0.2 (24.11.2008)

    • [piranha] Django and WSGI middlewares
    • [piranha] added as firepython package to PyPI index
    • [darwin] fixed Logger panel styles when Firebug window was detached from main window
  • v0.1 (15.11.2008)

    • [darwin] public alpha release
    • [darwin] initial server-side support for Python and Google App Engine
    • [darwin] communication via response headers
    • [darwin] logging module functionality (debug, info, warning, error, critical)
    • [darwin] log record filtering by type
    • [darwin] log record searching
    • [darwin] opening files in TextMate (click to timestamp field)