My favorites | Sign in
Project Home Wiki Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 409: sprintf implementation for firebug console.log
8 people starred this issue and may be notified of changes. Back to list
Reported by urkle0, Dec 12, 2007
Attached is a fairly complete sprintf implementation I wrote that allows
fully formated % variables in strings.  You can use this code to add
support for numeric formatting, etc in console.log. 

And by fairly complete, I think the only thing I didn't implement is 'p'
(pointer) as that isn't possible in JS
8.3 KB   View   Download
Dec 12, 2007
Project Member #1
Thanks! Please include your name, email address, and license info (eg BSD in the text of the .js file.
Also, if you work under contract (eg employed by a company), please add your
affiliation information; many multinationals think they own everything you do ;-).

I don't know if we will use this, because I don't know if there would be enough users
to balance the effort to maintain it.  Test cases and requests from users would help.

Labels: -Type-Defect Type-Enhancement console
Jan 11, 2008
#2 urkle0
OK, I've updated the file w/ a BSD License.
I'll write up a few test cases to demonstrate the functionality.

I'd be willing to maintain it w/o an issue.. Plus the way I've designed the 
implementation it is very easy to extend w/ new letters (like the existing '%o')

10.0 KB   View   Download
Mar 17, 2008
Project Member #3
(No comment was entered for this change.)
Labels: contribution
Nov 27, 2008
If it doesn't manage to get into core, would be nice to have it as FB extension.
Aug 30, 2011
urkle0, if you're still interested in this after that long time, I'd suggest you create a patch against the 1.9 branch.
The current Firebug implementation looks like this:

So just to note: console.log() already has some formatting since version 1, but the current implementation doesn't allow for more complex formatting.
See for more info about this.
Status: Triaged
Labels: Test-case-needed
Mar 23, 2013
Project Member #6
(No comment was entered for this change.)
Sign in to add a comment

Powered by Google Project Hosting