[TIMOB-11778] iOS: Ti.API: console.log and console.timestamp output prefixed with [ERROR] depending on previous message
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-11-07T01:35:33.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2013 Sprint 23, 2013 Sprint 23 Core, Release 3.2.0 |
Components | iOS |
Labels | qe-sdk3.0.2, regression |
Reporter | Dustin Hyde |
Assignee | Chris Barber |
Created | 2012-11-15T15:47:01.000+0000 |
Updated | 2013-11-14T06:31:39.000+0000 |
Description
The new CLI is prefixing log output with
[DEBUG]
.
The cases are:
Ti.API.log('unknown_level', ...)
and
Ti.API.timestamp(...)
Steps to Reproduce:
1. Run code:
Ti.API.log('LOG', 'Ti.API.log LOG');
Ti.API.log('LOG', ['Ti.API.log LOG', 'ARG1', 'ARG2']);
if(Ti.Platform.osname == 'iphone' || Ti.Platform.osname == 'ipad')
{
Ti.API.timestamp('Ti.API TIMESTAMP');
Ti.API.timestamp(['Ti.API TIMESTAMP', 'ARG1', 'ARG2']);
}
Actual Result:
[DEBUG] [LOG] Ti.API.log LOG
[DEBUG] [LOG] (
[DEBUG] "Ti.API.log LOG",
[DEBUG] ARG1,
[DEBUG] ARG2
[DEBUG] )
[DEBUG] [TIMESTAMP] 374602955.638459 Ti.API TIMESTAMP
[DEBUG] [TIMESTAMP] 374602955.638546 (
[DEBUG] "Ti.API TIMESTAMP",
[DEBUG] ARG1,
[DEBUG] ARG2
[DEBUG] )
Expected Result:
[LOG] Ti.API.log LOG
[LOG] (
"Ti.API.log LOG",
ARG1,
ARG2
)
[TIMESTAMP] 374624326.619975 Ti.API TIMESTAMP
[TIMESTAMP] 374624326.620025 (
"Ti.API TIMESTAMP",
ARG1,
ARG2
)
I would expect timestamp to print as INFO, or a custom TIMESTAMP (if possible).
Now the timestamp (and freeform 'LOG') is printed as ERROR.
Titanium Studio: 3.0.2.201302081641 Titanium SDK: 3.0.2.v20130207164659 Titanium CLI: 3.0.23 OS: 10.8.2 Xcode: 4.6 iPhone Simulator: 6.1
It seems the log level is dependent on if there is an array argument. Console calls without an array argument log to ERROR (incorrect). Console calls with an array argument, if called directly after, log to ERROR (incorrect). Console calls with an array argument, if called separately, log to INFO (correct). See Sample Code:
Output:
Regression. Works in 2.1.4.
Pull request: https://github.com/appcelerator/titanium_mobile/pull/4919
Verified with test environment: Appcelerator Studio: 3.2.0.201311122338 SDK:3.2.0.v20131113183932 alloy: 1.3.0 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0 titanium-code-processor: 1.1.0 Xcode:5.0.2 Device: Iphone 5s(v7.0.2) OS: Mac OSX 10.9
Result as expected: [LOG] Ti.API.log LOG [LOG] ( "Ti.API.log LOG", ARG1, ARG2 ) [TIMESTAMP] 406103132.967310 Ti.API TIMESTAMP [TIMESTAMP] 406103132.968250 ( "Ti.API TIMESTAMP", ARG1, ARG2 ) Closing as verified and getting expected result.