New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ios)(8_0_X) : Added log functionality #10922
Conversation
Tests:
|
iphone/Classes/TiUIWebView.m
Outdated
@@ -443,6 +443,9 @@ - (WKUserScript *)userScriptTitaniumInjectionForAppEvent | |||
warn: function(message){ \ | |||
window.webkit.messageHandlers._Ti_.postMessage({name:'warn', method: 'log', callback: Ti._JSON({level:'warn', message:message},1)},'*'); \ | |||
}, \ | |||
log: function(level, message){ \ | |||
window.webkit.messageHandlers._Ti_.postMessage({name:'level', method: 'log', callback: Ti._JSON({level:'level', message:message},1)},'*'); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're passing in the string literal 'level'
instead of the actual value of the level
argument.
Also is there any way to add a test for this? Open a Ti.UI.WebView, have it call Ti.API.log('warn', 'message'); and verify it actually occurred somehow? (I'm guessing not, since it goes directly to our APIModule and we can't intercept it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks!
I don't think we can write test case for same reason as you have mentioned. Probably we can add event listener in APIModule and fire some event when log api get called. For this we have to make some modification inside APIModule. I am not sure if it is right way.
FR Passed. logs shown as expected in console . |
Jenkin failed. Not able to merge PR. waiting for resolving jenkin's failure |
JIRA: https://jira.appcelerator.org/browse/TIMOB-27054