Extending FirePHP templates

6 messages Options
Embed this post
Permalink
André () Extending FirePHP templates
Reply Threaded More More options
Print post
Permalink
Hi,

in my PHP scripts I employ some logging functions that collect additional data in case of an error. I want to present this data using FirePHP.

Since the rendering of the FirePHP entries in the Firebug console is implemented client-side, I probably have to create a new template in the manner of those in RequestProcessor.js.

I don't know yet how to make this template available to FirePHP. Can you point me to some ideas how to deploy and register the new template?

Regards,
André
Christoph Dorn () Re: Extending FirePHP templates
Reply Threaded More More options
Print post
Permalink
Take a look at http://www.firephp.org/Wiki/Reference/CustomizeDisplay

If you need more info or run into problems getting it working let me know.

Are you open to sharing your templates? If they are of generic enough use I could incorporate them into FirePHP.

Let me know how this works out for you.
André () Re: Extending FirePHP templates
Reply Threaded More More options
Print post
Permalink
So you suggest disabling the original processor altogether and not extending it?

When (and if) I'm finished, I'll send you the code, so you can see if it is of any use for you.
Christoph Dorn () Re: Extending FirePHP templates
Reply Threaded More More options
Print post
Permalink
I would take the original processor and add to it.

You can see an example here: http://www.firephp.org/Wiki/Libraries/Ruby
André () Re: Extending FirePHP templates
Reply Threaded More More options
Print post
Permalink
Hi again,

in the meantime I spent several evenings trying to figure out how it works but I didn't quite get a result.

If I understood you correctly, I have to sent an X-FirePHP-ProcessorURL header to load my modified request processor. To make the js file that forms the request processor, I take the original file and modify it.

Sure, I see how this and that single function works but I don't get the whole idea. In addition, there are functions of which I could not even find out what their parameters mean. Maybe you could provide me with a small introduction.

What I am trying to get eventually is a log entry, like the ones produced by FirePHP::error or FirePHP::info but which is expandable and then shows a list of key/value pairs (application state info like "Database: has been connected"). It should then be expandable a second time to show a stack trace.

Now I'll try to give some points that particularly confused me:

On the server side, it seems to me that always a stack trace is derived and which is then enriched with information that is not in the stack trace (in FirePHP::fb, the @see link is down). On the client side some information is extracted from the first stack frame but I cannot see a regularity which information are sent in the first stack frame and which is sent seperately. Has this just "evolved historically"?

My biggest stumbling block was understanding the request processor. From what I see, all messages are handed to the logToFirebug() function. Some of them are later processed by getTraceTemplate(), after some obscure template selection process. But they are not simply rendered by this function but parts are rendered somehow internally, maybe by Firebug.Console.logRow()? Then there are "FirebugReps" objects involved, I absolutely have no idea what they are for. Further, some of the objects that are handed back and forth are "domplate" objects, so I checked this (http://www.softwareishard.com/blog/planet-mozilla/domplate-examples-part-i/) domplate tutorial, but I could not put it in the context. I could not even figure out where the error/warning/info icons come from. :(

Can you cast some light to all this?

Best regards,
André
Christoph Dorn () Re: Extending FirePHP templates
Reply Threaded More More options
Print post
Permalink
There is no documentation on how the request processor works internally and how it interacts with firebug and domplate. A lot of this has evolved over time.

I am currently in the process of re-writing FirePHP from the ground up to make extensibility much easier. Since I have started this work I will not be documenting the current system. Feel free to join the developer mailing list to keep an eye on new releases: http://groups.google.com/group/firephp-dev

As a work-around I think you can accomplish what you are trying to do using a a couple of collapsed groups and a table message. See: http://www.firephp.org/HQ/Use.htm