2 if (typeof global.console != "undefined") {
6 var toString = function(item) {
8 if (t == "undefined") {
10 } else if (t == "string") {
12 } else if (t == "number") {
14 } else if (item instanceof Array) {
21 var log = function(hint, args){
24 r += ((hint ? hint + ":" : "") + (args[0] ? toString(args[0]) : ""));
25 for(var i = 1; i < al; i++){
26 r += (" " + toString(args[i]));
31 var makeLogger = function(hint) {
33 log(hint, Array.prototype.slice.call(arguments, 0));
37 // Intentionally define console in the global namespace
40 error: makeLogger("ERROR"),
41 warn: makeLogger("WARN"),
42 trace: makeLogger("TRACE"),
44 timeEnd: function() {},
45 profile: function() {},
46 profileEnd: function() {},