define(["Ti/_/Evented", "Ti/_/lang"], function(Evented, lang) {

	var api = {},
		global = window,
		con = global.console,
		i = 0,
		last,

		// the order of these DOES matter... it uses the last known function
		// (i.e. if trace() does not exist, it'll use debug() for trace)
		fns = ["debug", "trace", "error", "fatal", "critical", "info", "notice", "log", "warn"],
		afns = ["debug", "info", "warn", "error", "trace"];
	// console.*() shim
	con === void 0 && (con = global.console = {});

	// make sure "log" is always at the end
	afns.forEach(function(c) {
		con[c] || (con[c] = ("log" in con)
			?	function () {
					var a = Array.apply({}, arguments);
					a.unshift(c + ":");
					con.log(a.join(" "));
				}
			:	function () {}
		);
	});

	con.trace = 0; // need to undefine trace() since it does something completely different

	for (; i < 9; i++) {
		(function(fn) {
			var ls = last = console[fn] ? fn : last;
			api[fn] = function() {
				console[ls]("[" + fn.toUpperCase() + "] " + lang.toArray(arguments).map(function(a) {
					return require.is(a, "Object") ? a.hasOwnProperty("toString") ? a.toString() : JSON.stringify(a) : a === null ? "null" : a === void 0 ? "undefined" : a;
				}).join(' '));
			};
		})(fns[i]);
	}

	api.log = function () {
		var a = lang.toArray(arguments);
		var fn = ~afns.indexOf(('' + a[0]).toLowerCase()) && a.shift().toLowerCase();
		api[fn||'info'].apply(this, a);
	};

	return lang.setObject("Ti.API", Evented, api);

});
@@ -272,18 +272,20 @@
  trace)%0A
-%09%09
+    
 fns = %5B%22
@@ -330,24 +330,16 @@
 itical%22,
- %22info%22,
  %22notice
@@ -346,73 +346,20 @@
 %22, %22
-log%22, %22warn%22%5D,%0A%09%09afns = %5B%22debug%22, %22info%22, %22warn%22, %22error%22, %22trace
+warn%22, %22info
 %22%5D;%0A
@@ -469,18 +469,17 @@
 the end%0A
+
 %09
-a
 fns.forE

remove extra array