sort console.log order by time.

64 views
Skip to first unread message

Voathnak Lim

unread,
Jul 7, 2014, 11:46:57 PM7/7/14
to fir...@googlegroups.com
Hello, I wonder is there is an option that allow me to sort the order of console log by time?, Example: I want the last console appear at the top.

Jan Honza Odvarko

unread,
Jul 8, 2014, 1:44:19 AM7/8/14
to fir...@googlegroups.com
Such option doesn't exist at the moment.

You might want to file a bug here:
https://code.google.com/p/fbug/issues/list

Honza

Lawrence San

unread,
Jul 8, 2014, 1:45:19 PM7/8/14
to fir...@googlegroups.com
Speaking of console arrangement... that reminds me of something I've been wishing for, although it's rather elaborate and a little hard to explain. I'm working on code where groups of console log items appear in clumps, separated by time, depending on various actions. In other words: something happens, 6 or 8 console items appear; 10 seconds later, another page action, 10 more console items appear, etc.

Right now there's no separation between the groups of items in the console. They're not the kind of thing you could easily clump into console.group because they come from various parts of the code (not all together in the code).

It would be nice if you could set an amount of time (a time gap) that would cause a separator to automatically appear in the console, like a horizontal line, so you could see where one bunch of items stopped and the next began. Even better would be some way to automatically group them (something like console.groupCollapsed) as soon as the next bunch of items appeared.

Lawrence San
Business Writing: Santhology.com
Cartoon Stories for Thoughtful People: Sanstudio.com




--
You received this message because you are subscribed to the Google Groups "Firebug" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebug+u...@googlegroups.com.
To post to this group, send email to fir...@googlegroups.com.
Visit this group at http://groups.google.com/group/firebug.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebug/8db1e909-af01-49b4-9b1f-02d610d5d834%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

David Gomez

unread,
Jul 9, 2014, 1:50:57 PM7/9/14
to fir...@googlegroups.com

At first sight, "order of console log by time" should be easy:

https://github.com/firebug/firebug/blob/master/extension/content/firebug/console/consolePanel.js#L661
           
var orderTimeASC=false;//Firebug Preference
if (Options.get("console.groupLogMessages") && this.matchesLastMessage &&
   
this.matchesLastMessage(objects, appender, className, rep, sourceLink,
       
this.groups ? this.groups.length : 0))
{
   
if(orderTimeASC)
   
{
       
this.increaseRowCount(container.lastChild);
        row
= container.lastChild;
   
}
   
else
   
{
       
this.increaseRowCount(container.firstChild);
        row
= container.firstChild;
   
}
}
else
{
   
if (sourceLink)
       
FirebugReps.SourceLink.tag.append({object: sourceLink}, row.firstChild);

   
if(orderTimeASC)
   
{
        container
.appendChild(row);
   
}
   
else
   
{
        container
.insertBefore(row, container.firstChild);
   
}
}

................
//TODO
if (this.wasScrolledToBottom)
    Dom.scrollToBottom(this.panelNode);//scrollToTop

David

Sebastian Zartner

unread,
Jul 14, 2014, 7:33:28 AM7/14/14
to fir...@googlegroups.com
I wonder what's the reason of sorting the logs the other way round. Could it be that your actual problem is that the console doesn't automatically scroll to the very last entry?

For the message grouping you may want to create an enhancement request.

Sebastian
Reply all
Reply to author
Forward
0 new messages