How to use the log.args function in log

To help you get started, we’ve selected a few log examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator-developer-relations / appc-sample-ti520 / app / controllers / ios / livephoto.js View on Github external
function handleResponse(e) {
  log.args('Ti.Media.openPhotoGallery', e);

  if (!e.success) {
    return alert(e.error || 'Error #' + e.code);
  }

  if (e.mediaType !== Ti.Media.MEDIA_TYPE_LIVEPHOTO) {
    return alert('This should never happen. We required a Live Photo but somehow you selected something else.');
  }

  if (!e.livePhoto) {
    return alert('This should never happen. If mediaType says you selected a Live Photo it should be there.');
  }

  $.livePhotoView.livePhoto = e.livePhoto;

  // Programmatically triggering playback isn't recommended in any other use case
github appcelerator-developer-relations / appc-sample-ti510 / app / controllers / permissions.js View on Github external
function calendar(e) {

	// The new cross-platform way to check permissions
	var hasCalendarPermissions = Ti.Calendar.hasCalendarPermissions();
	log.args('Ti.Calendar.hasCalendarPermissions', hasCalendarPermissions);

	if (hasCalendarPermissions) {

		// We have to actually use a Ti.Calendar method for the permissions to be generated
		// FIXME: https://jira.appcelerator.org/browse/TIMOB-19933
		log.args('Ti.Calendar.getAllCalendars', Ti.Calendar.getAllCalendars());

		return alert('You already have permission.');
	}

	// On iOS we can get information on the reason why we might not have permission
	if (OS_IOS) {

		// Map constants to names
		var map = {};
		map[Ti.Calendar.AUTHORIZATION_AUTHORIZED] = 'AUTHORIZATION_AUTHORIZED';
github appcelerator-developer-relations / appc-sample-ti510 / app / controllers / ios.js View on Github external
log.args('Starting unoptimized operations..');

		collection.forEach(function(model, n) {

			// do something heavy, like creating rows to add to a table
			Ti.Platform.createUUID();

			$.progressBar.value = progressAsc ? n : (Alloy.CFG.threadOperations - 1 - n);

		});

		progressAsc = !progressAsc;
		progressRunning = false;

		log.args('Finished operations..');
	}

	// OPTIMIZED CODE

	// If the switch is on use code optimized for single thread.
	// Result will be ~ same if main thread is DISABLED or ENABLED
	// because each call to $.progress.value will be either executed inmediately (DISABLED)
	// or before the next call to doSomething, which is stacked after it.

	// Use Underscore's _.defer()
	if (e.index === 1) {

		log.args('Starting operations optimized using _.defer() ..');

		function doSomething(n) {
github appcelerator-developer-relations / appc-sample-ti520 / app / controllers / index.js View on Github external
Ti.App.iOS.addEventListener('continueactivity', function(e) {
      log.args('Ti.App.iOS:continueactivity', e);

      // Activate the tab active on the other device
      if (e.activityType === 'com.appcelerator.sample.ti520.tab') {
        $.index.tabs[e.userInfo.activeTabIndex].active = true;
      }

    });
github appcelerator-developer-relations / appc-sample-3dtouch / app / controllers / details.js View on Github external
function removeDetailsShortcut() {

	// Other than in list.js we don't need to check the userInfo.filename
	// since we will replace it if we're called from the constructor or it
	// is the one we created there and now remove in deletePicture()
	appShortcuts.removeDynamicShortcut('details');

	log.args('Ti.UI.iOS.ApplicationShortcuts.removeDynamicShortcut', 'details');
}
github appcelerator-developer-relations / appc-sample-ti520 / app / controllers / tab.js View on Github external
function onTabSelection(e) {
  log.args('Ti.UI.Tab:' + e.type, e);
}
github appcelerator-developer-relations / appc-sample-ti520 / app / controllers / index.js View on Github external
function logDimensions(e) {
    log.args('Ti.App:' + e.type + ' was fired and our dimensions are:', {
      'Ti.Platform.displayCaps.platformWidth': Ti.Platform.displayCaps.platformWidth,
      'Ti.Platform.displayCaps.platformHeight': Ti.Platform.displayCaps.platformHeight,
      '$.index.size.width': $.index.size.width,
      '$.index.size.height': $.index.size.height
    });
  }
github appcelerator-developer-relations / appc-sample-ti520 / app / controllers / ios / keyboard.js View on Github external
function changeKeyboardType(e) {
  var keyboardType = 'KEYBOARD_TYPE_' + e.source.labels[e.index].title;
  log.args('keyboardType', 'Ti.UI.' + keyboardType);

  $.textField.keyboardType = Ti.UI[keyboardType];
  $.textField.blur();
}