How to use the core.log function in core

To help you get started, we’ve selected a few core 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 freedomjs / freedom-pgp-e2e / src / samples / chrome-app / freedom.ts View on Github external
/// 
/// 
/// 
/// 


module E2eSample {
  // TODO: grab logger from freedom.core().getLogger('name')
  // once this depends on freedom 0.6
  // (i.e. after cutting out uproxy-lib dependency)
  var log :Freedom_UproxyLogging.Log = freedom['core.log']('Diagnose');
  var logManager :Freedom_UproxyLogging.LogManager = freedom['core.logmanager']();
  var e2e :E2eProvider = freedom['e2e']();

  freedom.on('command', function(m) {
    log.debug('received command %1', [m]);
    if (m == 'pgp_test') {
      doPgpTest();
    }
  });

  freedom.on('getLogs', function() {
    logManager.getLogs()
        .then(function(strs: string[]) {
          for (var i = 0; i < strs.length; i++) {
            freedom.emit('print', strs[i]);
          }
github BOXOUT-THINKERS / TiOpenChat / app / lib / tiparsejs_wrapper.js View on Github external
error: function (error) {
          require("core").log('error', 'Parse.hCloud.run / ' + _fnName + ' / retry left ' + _options.retryLeft + ' : ' + JSON.stringify(error));
          if (!_options.retryLeft || _options.retryLeft <= 0) {
            _options && _.isFunction(_options.error) && _options.error(error);
            deferred.reject(error);
          } else {
            // retry
            _options.retryLeft--;
            that.runner(_fnName, _arguments, _options);
          }
        }
      });
github gimdongwoo / NIPA-Titanium-BoilerPlate-BaaS / app / lib / tiparsejs_wrapper.js View on Github external
error: function (error) {
          require("core").log('error', 'Parse.hCloud.run / ' + _fnName + ' / retry left ' + _options.retryLeft + ' : ' + JSON.stringify(error));

          // 124 : RequestTimeout, 100 : ConnectionFailed
          if (!_options.retryLeft || _options.retryLeft <= 0 || (error.code != 124 && error.code > 100)) {
            _options && _.isFunction(_options.error) && _options.error(error);
            deferred.reject(error);
          } else  {
            // retry
            _options.retryLeft--;
            // Exponentially-growing random delay
            var delay = Math.round(
              Math.random() * 125 * Math.pow(2, (REQUEST_ATTEMPT_LIMIT - _options.retryLeft))
            );
            setTimeout(function() {
              that.runner(_fnName, _arguments, _options);
            }, delay);
          }
github gimdongwoo / NIPA-Titanium-BoilerPlate-BaaS / app / lib / push / parse.js View on Github external
.fail(function(error) {
			APP.log("error", "Installation fetch fail : ", APP.SettingsM.get('Installation_objectId'), error);

			// retry 5 count
			if (errorCount < 5) {
				errorCount++;
				APP.log("error", "Installation fetch Retry : " + errorCount + '/5');
				exports.setUserInfo(userM, errorCount);
			} else {
				APP.SettingsM.set('Installation_objectId', undefined).save();
			}
		});
	} else {
github gimdongwoo / NIPA-Titanium-BoilerPlate-BaaS / app / lib / push / parse.js View on Github external
var onRegistError = function(e){
		// APP.alert('Fail to registered parse push');
		APP.log("debug", "Parse.registeriOS @error");
		APP.log("trace", JSON.stringify(e));
	};
github CBMVC / ChariTi-CB / app / controllers / article_article.js View on Github external
$.init = function() {
	APP.log("debug", "article_article.init | " + JSON.stringify(CONFIG));

	MODEL.init(CONFIG.index);

	$.handleData(MODEL.getArticle(CONFIG.id));
};
github CBMVC / ChariTi-CB / app / controllers / flickr_photo.js View on Github external
$.init = function() {
	APP.log("debug", "flickr_photo.init | " + JSON.stringify(CONFIG));

	MODEL.init(CONFIG.index);
	MODEL.setApiKey(CONFIG.apiKey);

	$.handleData(MODEL.getPhoto(CONFIG.id));
};
github CBMVC / ChariTi-CB / app / controllers / event_event.js View on Github external
$.init = function() {
	APP.log("debug", "event_event.init | " + JSON.stringify(CONFIG));

	MODEL.init(CONFIG.index);

	$.handleData(MODEL.getEvent(CONFIG.id));
};
github CBMVC / ChariTi-CB / app / controllers / flickr_photo.js View on Github external
$.handleData = function(_data) {
	APP.log("debug", "flickr_photo.handleData");

	PREVIOUS = MODEL.getPhoto(null, (parseInt(_data.index, 10) - 1).toString(), CONFIG.setid);
	NEXT = MODEL.getPhoto(null, (parseInt(_data.index, 10) + 1).toString(), CONFIG.setid);

	$.image.image = _data.url_m;
	$.title.text = _data.title ? _data.title : "";

	if(_data.description) {
		$.description.text = _data.description.substring(0, 150);
	} else {
		$.meta.remove($.description);
		$.title.bottom = "15dp";
	}
};
github CBMVC / ChariTi-CB / app / controllers / settings_credits.js View on Github external
$.init = function() {
	APP.log("debug", "settings_credits.init");

	$.NavigationBar.setBackgroundColor(APP.Settings.colors.primary);

	$.NavigationBar.showBack(function(_event) {
		APP.removeChild({
			modal: true,
			animation: APP.AnimationStyle.NavRight
		});
	});
};

core

Core Libs

Unknown
Latest version published 7 years ago

Package Health Score

34 / 100
Full package analysis

Popular core functions