[TIMOB-26115] TiAPI: Add support for console.timeLog
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-07-11T20:20:50.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.5.0 |
Components | TiAPI |
Labels | android, ios, windows |
Reporter | Christopher Williams |
Assignee | Ewan Harris |
Created | 2018-06-08T14:53:01.000+0000 |
Updated | 2018-12-19T19:29:03.000+0000 |
Description
it would be very useful to have the ability to output timing to the log for testing and debugging.
We have already added console.time and console.timeEnd. Due to some ambiguities around calling timeEnd multiple times for the same label, they introduced console.timeLog to handle printing intermediate timings without removing the timer/label. We should expand to support this as well.
https://github.com/whatwg/console/pull/138
Also note that there's a good number of other apis we may want to consider adding to match web/node compatibility. https://nodejs.org/api/console.html https://github.com/nodejs/node/blob/master/lib/console.js https://developer.mozilla.org/en-US/docs/Web/API/Console I think the most relevant methods are: - assert - count - countReset - group - groupEnd - table
+1 for group, groupEnd and table!
[~cwilliams]/[~hknoechel] Do either of you share concerns of landing this before the spec lands. I'd like to get this in when time permits but I'm hesitant to do so while it's not full part of the spec. For the others, I think the ones you called out make sense to implement. But I would like to maybe wait until TIMOB-26015 lands, then try and align all platforms to use the same code rather than 2 similar JS implementations and 1 Objective-C one, does that makes sense to you, and am I understanding the potential of that feature correctly?
Windows: https://github.com/appcelerator/titanium_mobile_windows/pull/1267 Android/iOS: https://github.com/appcelerator/titanium_mobile/pull/10156
*Closing ticket.* Verified improvement on SDK version:
7.5.0.v20180913035354
able to log times, log times with additional information and the ability to handle Arrays and Objects usingconsole.timelog
Tested on Windows, iOS and Android. *Test steps*Created a new Titanium application
Added the following code to an application (default application)
Installed app on to the device/Simulator
Ran the app
Able to see the console output timer with the correct information
*Environment*