How do you propose we include this in web2py? Should I just dump it in
contrib?
I have a feeling this should integrated with the logging function
recently proposed (for that what is logged is also sent to firebug).
What do you think?

Massimo

On Jun 10, 2:12 pm, sgtpep <[email protected]> wrote:
> Newer version uploaded and accessible by the link above.
>
> You can see screenshot of what you'll 
> get:http://www.picamatic.com/view/3948659_109510221650-My-Desktop/
>
> What's added:
> - skipping web2py debug messages (starts with "WEB2PY CRON")
> - situations: you have a page with self-submitting form or one view
> redirects to other, and all them executes some db queries; now you can
> see the request path and method (post/get) of latest executed http
> requests. If db queries are executed within one http request than this
> column is hidden.
> - you can see a very simple stack trace of code execution that
> initializes each db query. See screenshot. This feature is still
> alpha.
>
> TODO:
> - show some caching system statistics in form of db query stats (as
> FirePHP table): which keys are got, set and so on.
> - checking for duplicating db queries and highlighting them.
>
> On 3 июн, 18:00, mdipierro <[email protected]> wrote:
>
> > You are now officially our firebug expert!
>
> > Massimo
>
> > On Jun 3, 5:19 am, sgtpep <[email protected]> wrote:
>
> > > Unfortunately I have no expirience in screencasting, and my English is
> > > buggy.
>
> > > Debugging/logging tool is very useful thing for web development. I
> > > really like this one in Symfony framework (it is included to Symfony
> > > and made with JavaScript, screenshot 
> > > -http://www.symfony-project.org/blog/2008/08/27/new-in-symfony-1-2-cus...).
> > > For Django there is third-party module Django Debug Toolbar (http://
> > > rob.cogit8.org/blog/2008/Sep/19/introducing-django-debug-toolbar/).
>
> > > I think the most valuable things that this type of tools can show for
> > > developer are: accessible report to server-side logs pre request, info
> > > about queries executed during request and maybe some cache stats and
> > > variables list.
>
> > > Firebug (http://getfirebug.com/) is the most popular Firefox extension
> > > for web developent, very handy and well-built. It implements
> > > JavaScript console, DOM traversing, JS-debugging and lot more. FirePHP
> > > (http://www.firephp.org/) is another extension that uses Firebug
> > > interface and resources and therefore requires Firebug for work. You
> > > can see demo here (Firefox with both extensions required, open and
> > > enable Firebug console to see output) 
> > > -http://www.firephp.org/Examples/PHPArchitect/.
> > > In two words, FirePHP allows you to output log messages that you
> > > passed from PHP code, displays executed db queries, stack trace of
> > > exceptions, etc. It requires of using PHP class FirePHPCore/
> > > FirePHP.class.php. Firepy (documentation and screenshot 
> > > -http://code.google.com/p/firepy/wiki/Documentation) is the
> > > implementation for Python of the server-side FirePHP library, but it
> > > uses the same Firefox extension (FirePHP). And it includes Middleware
> > > for using with Django, but you can easily adopt it for any Python
> > > framework.
>
> > > How-to for using FirePHP with web2py:
> > > 1) Open Firefox, install Firebug, FirePHP 
> > > addons:https://addons.mozilla.org/ru/firefox/addon/1843,https://addons.mozil....
> > >  Restart browser.
> > > 2) Downloadhttp://www.box.net/shared/dtm0dhgze9andextract'firepy'
> > > folder.
> > > 3) Open directory with your current web2py application, and copy
> > > 'firepy' folder into 'modules' directory of application.
> > > 4) Edit first file in 'models' folder in your application (via web- or
> > > desktop-editor). Place these lines in top of the file:
>
> > > import sys
> > > sys.path += ['applications/%s/modules' % request.application]
> > > from firepy.web2py import start_firepy
> > > start_firepy(globals())
>
> > > 5) Edit some controller file and add this line to some controller
> > > function: logging.debug([1, {"asdf":(123, 2, "3")}, "3"])
> > > 6) Click on bug icon on bottom status line of Firefox. This will bring
> > > up panel. Check the checkbox "Console" and click "Apply settings".
> > > Ensure that tab "Console" is showing.
> > > 7) Navigate from browser to this application/controller/function. And
> > > now you should see your logging output in console ([1, {"asdf":(123,
> > > 2, "3")}, "3"]). If controller executes some db queries, then console
> > > will contain some info about them (sample 
> > > screenshothttp://firepy.googlecode.com/files/firepy.png). This is very
> > > interesting to know raw SQL-queries (especially for eduction, and for
> > > finding redundant or duplicating queries).
>
> > > Notice: Logs shows only if you are autorized in admin application.
> > > This check prevents from showing debugging logs for non-
> > > administrators.
>
> > > One disadvantage of this way is that it requires Firefox. But if you
> > > open your site in other browsers no errors will occur (logging info
> > > passes via HTTP headers). One possible way to support other browsers
> > > is to use Firebug Lite (pure JS implementation of extension) for them
> > > (http://getfirebug.com/lite.html) and modify or extend its code for
> > > adding FirePHP functionality.
>
> > > BTW, web2py is great, I really was charmed with it. It is most pytonic
> > > web framework and more flexible than most of them (I think it beats
> > > Django as well). Such debugging possibility will be a nice addition
> > > for it.
>
> > > On 3 июн, 08:10, mdipierro <[email protected]> wrote:
>
> > > > I am new to this. I can tell this is very usefull but I do not know
> > > > how to make it work.
>
> > > > Any chance you can make a short video showing it (perhaps using Jing)?
>
> > > > Do you feel it should be included in web2py? How?
>
> > > > Massimo
>
> > > > On Jun 2, 9:04 am, sgtpep <[email protected]> wrote:
>
> > > > > Source files were updated in archive. Some issues were fixed. And also
> > > > > logs shows in console now if you are authorized in admin application.
> > > > > I forgot to mention what features of frepy are ready for working with
> > > > > web2py:
> > > > > - server-side logging using logging module
> > > > > - db query logging (!) with timing and multiple databases support
> > > > > Custom exception handler are not working yet because web2py owerrides
> > > > > it with own one.
>
> > > > > On 2 июн, 10:02, sgtpep <[email protected]> wrote:
>
> > > > > > Hi, web2pyers!
> > > > > > Everyone knows Firebug, the perfect webdeveloper tool. There is also
> > > > > > FirePHP addon for using Firebug facilities for server side 
> > > > > > debugging/
> > > > > > logging. And recently I found firepy (http://code.google.com/p/
> > > > > > firepy/). It makes available to use FirePHP with Django.
> > > > > > I have added a bit of code to firepy source for making possible to 
> > > > > > use
> > > > > > it with web2py.
> > > > > > Here it is (sorry, I have no time to commit it to firepy or web2py
> > > > > > distribution, mayby later):http://www.box.net/shared/dtm0dhgze9
>
> > > > > > For using place firepy folder to modules directory of your 
> > > > > > application
> > > > > > and add these lines of code at the begining of your models code:
> > > > > > import sys
> > > > > > sys.path += ['applications/%s/modules' % request.application]
> > > > > > from firepy.web2py import start_firepy
> > > > > > start_firepy(globals())
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to