1 // The class this file defines and its required classes 2 R.Engine.define({ 3 "class":"R.util.console.Firebug", 4 "requires":[ 5 "R.debug.ConsoleRef" 6 ] 7 }); 8 9 /** 10 * @class A console reference to the Firebug console. This will work with both Firebug and FirebugLite. 11 * @extends R.debug.ConsoleRef 12 */ 13 R.util.console.Firebug = R.debug.ConsoleRef.extend(/** @scope R.util.console.Firebug.prototype **/{ 14 15 constructor:function () { 16 }, 17 18 /** 19 * Write a debug message to the console 20 */ 21 info:function () { 22 if (typeof firebug !== "undefined") { 23 firebug.d.console.log.apply(firebug.d.console, arguments); 24 } else { 25 console.info.apply(console, arguments); 26 } 27 }, 28 29 /** 30 * Write a debug message to the console 31 */ 32 debug:function () { 33 if (typeof firebug !== "undefined") { 34 firebug.d.console.log.apply(firebug.d.console, arguments); 35 } else { 36 console.debug.apply(console, arguments); 37 } 38 }, 39 40 /** 41 * Write a warning message to the console 42 */ 43 warn:function () { 44 if (typeof firebug !== "undefined") { 45 firebug.d.console.log.apply(firebug.d.console, arguments); 46 } else { 47 console.warn.apply(console, arguments); 48 } 49 }, 50 51 /** 52 * Write an error message to the console 53 */ 54 error:function () { 55 if (typeof firebug !== "undefined") { 56 firebug.d.console.log.apply(firebug.d.console, arguments); 57 } else { 58 console.error.apply(console, arguments); 59 } 60 }, 61 62 /** 63 * Write a stack trace to the console 64 */ 65 trace:function () { 66 if (typeof firebug !== "undefined") { 67 console.trace.apply(arguments); 68 } 69 }, 70 71 /** 72 * Get the class name of this object 73 * 74 * @return {String} The string "R.util.console.Firebug" 75 */ 76 getClassName:function () { 77 return "R.util.console.Firebug"; 78 } 79 }); 80