On Mar 20, 2006, at 12:42 PM, Doug Crawford wrote:
>
> Thanks, is there any way to send Mochikit Logging messages to the
> firebug console?
Sure. Take the printfire function from the FireBug FAQ:
printfire = function () {
if (window.console && window.console.log) {
// This is Safari JS Console support, not in the FAQ version
window.console.log(arguments[0]);
} else if (document.createEvent) {
printfire.args = arguments;
var ev = document.createEvent("Events");
ev.initEvent("printfire", false, true);
dispatchEvent(ev);
}
};
And then set up a logging listener as per the Logging docs:
http://mochikit.com/doc/html/MochiKit/Logging.html
Something like this would suffice:
printfire_listener = function (msg) {
printfire(msg.level + ": " + msg.info.join(""));
};
MochiKit.Logging.logger.addListener("printfire", null,
printfire_listener);
-bob
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---