The new Firebug 1.0 Beta supports sending objects to its console.log
and then being able to browse them in the GUI. This is very useful, but
MochiKit currently flattens out the objects to a string before passing
them to the console.log.

A quick simple fix:

First:

       if (this.useNativeConsole) {
           // JCHAM: pass msg object instead of str
           this.logToConsole(msg);
       }
       ...

Then:

   /** @id MochiKit.Logging.Logger.prototype.logToConsole */
   logToConsole: function (msg) {

       // ---- JCHAM: Firebug console.log object
        if (console && console.log) {
                // Firebug!
                var level = msg.level.toLowerCase();
                var f = console[level]? console[level] : console.log;
                f.apply(console, msg.info);
                return;
        }
       // ---- JCHAM: From here convert msg into a string, as orig
       var msg = msg.level + ": " + msg.info.join(" ");
       if (typeof(window) != "undefined" && window.console
               && window.console.log) {
       ...

This might break Safari and maybe won't work with other versions of
Firebug. Not really sure yet how if there is a way to detect the
presence of Firebug or previous versions of Firebug (how did
console.log behave in previous versions of Firebug?). More on that when
I get to it. Alternatively we could write a separate listener or Logger
class.

Jaime


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to