Skip to content
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

[TIMOB-10108] MobileWeb: Ti.API.log INFO level messages do not display as correct type #4057

Closed
wants to merge 4 commits into from

Conversation

euforic
Copy link
Contributor

@euforic euforic commented Mar 29, 2013

MobileWeb: Ti.API.log INFO level messages do not display as correct type

@@ -8,13 +8,13 @@ define(["Ti/_/Evented", "Ti/_/lang"], function(Evented, lang) {

// 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"];

fns = ["debug", "trace", "error", "fatal", "critical", "info", "notice", "log", "warn"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a comma at the end of the line.

@@ -38,6 +38,12 @@ define(["Ti/_/Evented", "Ti/_/lang"], function(Evented, lang) {
})(fns[i]);
}

api.log = function () {
var a = Array.prototype.slice.call(arguments);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also do

[].slice.call(arguments);

which is shorter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So actually, we have a method in lang called toArray that does this for you

@nebrius
Copy link
Contributor

nebrius commented Apr 5, 2013

MW crashes with the fix. Test Code:

Ti.API.debug('debug');
Ti.API.error('error');
Ti.API.info('info');
Ti.API.timestamp('timestamp');
Ti.API.trace('trace');
Ti.API.warn('warn');
Ti.API.log('log');
Ti.API.log('debug', 'debug');
Ti.API.log('error', 'error');
Ti.API.log('info', 'info');
Ti.API.log('timestamp', 'timestamp');
Ti.API.log('trace', 'trace');
Ti.API.log('warn', 'warn');

Exception:

Uncaught ReferenceError: afns is not defined

@nebrius
Copy link
Contributor

nebrius commented Apr 5, 2013

Also, it turns out we have the wrong list of APIs in Ti.API. We need to be at parity with the docs: http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.API

@nebrius
Copy link
Contributor

nebrius commented Apr 5, 2013

After doing some digging, we should leave in notice, critical, and fatal. They aren't documented, but the other platforms are basically doing the same thing we are. We do need to add support for timestamp though.

@nebrius
Copy link
Contributor

nebrius commented Aug 20, 2013

Closing because this PR is being superseded by a different one.

@nebrius nebrius closed this Aug 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants