[TIMOB-8780] Ti API: Add console.log support
| GitHub Issue | n/a | 
|---|---|
| Type | New Feature | 
| Priority | High | 
| Status | Closed | 
| Resolution | Fixed | 
| Resolution Date | 2012-05-29T08:46:59.000+0000 | 
| Affected Version/s | Release 2.0.1 | 
| Fix Version/s | Release 2.1.0, Sprint 2012-10 Core | 
| Components | TiAPI | 
| Labels | core, module_console, qe-port | 
| Reporter | Gabriel Tavridis | 
| Assignee | Stephen Tramer | 
| Created | 2012-04-18T13:43:07.000+0000 | 
| Updated | 2012-06-07T11:11:56.000+0000 | 
Description
	Add console.log support in Titanium Mobile
see article: http://crackcelerator.com/post/19742964227/console-log-support-in-appcelerator
Mobile web already supports console.*() functions. :)
Closing feature. Was able to use documented console.*() functions on: Tested on: SDK build: 2.1.0.v20120605190238 Titanium Studio, build: 2.1.0.201206051612 Runtime: v8 xcode: 4.3.2 Devices: Emulator 2.2, Simulator 5.1
For QE, when porting, use the following test code:
var win = Titanium.UI.createWindow({ title : 'Test', backgroundColor : '#fff', layout : 'vertical' }); var debugButton = Titanium.UI.createButton({ top : 20, left : 10, right : 10, height : 35, title : 'debug' }); win.add(debugButton); var errorButton = Titanium.UI.createButton({ top : 20, left : 10, right : 10, height : 35, title : 'error' }); win.add(errorButton); var infoButton = Titanium.UI.createButton({ top : 20, left : 10, right : 10, height : 35, title : 'info' }); win.add(infoButton); var logButton = Titanium.UI.createButton({ top : 20, left : 10, right : 10, height : 35, title : 'log' }); win.add(logButton); var warnButton = Titanium.UI.createButton({ top : 20, left : 10, right : 10, height : 35, title : 'warn' }); win.add(warnButton); debugButton.addEventListener('click', function() { console.debug('##### DEBUG !!!'); }); errorButton.addEventListener('click', function() { console.error('##### ERROR !!!'); }); infoButton.addEventListener('click', function() { console.info('##### INFO !!!'); }); logButton.addEventListener('click', function() { console.log('##### LOG !!!'); }); warnButton.addEventListener('click', function() { console.warn('##### WARN !!!'); }); win.open();