How to use the babel/utils/logging/Logger function in babel

To help you get started, we’ve selected a few babel 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 Esri / storymap-crowdsource / src / app / controllers / user / User.babel.js View on Github external
import $ from 'jquery';
import AppStore from 'babel/store/AppStore';
import lang from 'dojo/_base/lang';
import URI from 'lib/urijs/src/URI';
import OAuthInfo from 'esri/arcgis/OAuthInfo';
import IdentityManager from 'esri/IdentityManager';
import UserActions from 'babel/actions/UserActions';
import AppActions from 'babel/actions/AppActions';
import ArcgisItem from 'babel/utils/arcgis/items/Item';
import Logger from 'babel/utils/logging/Logger';
import viewerText from 'i18n!translations/viewer/nls/template';
import 'babel/utils/helper/strings/StringUtils';

const _logger = new Logger({source: 'User Controller'});

// const _onError = function onError(error) {
//   _logger.logMessage({
//     type: 'error',
//     error
//   });
// };

const _onStatus = function onStatus(message,debugOnly) {
  _logger.logMessage({
    type: 'status',
    debugOnly,
    message
  });
};
github Esri / storymap-crowdsource / src / app / components / forms / select / Select.babel.js View on Github external
import $ from 'jquery';
import React from 'react'; // eslint-disable-line no-unused-vars
import Helper from 'babel/utils/helper/Helper';
import FormGroup from 'babel/components/forms/base/FormGroup';
import Logger from 'babel/utils/logging/Logger';
import IconTooltip from 'babel/components/helper/tooltip/IconTooltip';
import ViewerText from 'i18n!translations/viewer/nls/template';

const formText = ViewerText.forms.select;

const _logger = new Logger({
  source: 'Select'
});

const _onError = function onError(err) {
  _logger.logMessage({
    type: 'error',
    error: err
  });
};

export default class Select extends FormGroup {

  constructor(props) {
    super(props);
  }
github Esri / storymap-crowdsource / src / app / controllers / builder / review / CrowdsourceReviewController.babel.js View on Github external
import $ from 'jquery';
import AppStore from 'babel/store/AppStore';
import lang from 'dojo/_base/lang';
import esriRequest from 'esri/request';
import Logger from 'babel/utils/logging/Logger';
import ReviewActions from 'babel/actions/ReviewActions';
import 'babel/utils/helper/strings/StringUtils';

const _logger = new Logger({source: 'Contribute Controller'});

const _onError = function onError(error) {
  _logger.logMessage({
    type: 'error',
    error
  });
};

export default class CrowdsourceReviewController {

  constructor() {

    // Autobind methods
    this.updateAppState = this.updateAppState.bind(this);
    this.editReviewedFeatures = this.editReviewedFeatures.bind(this);
github Esri / storymap-crowdsource / src / app / storymaps / core / data / Data.babel.js View on Github external
import $ from 'jquery';
import Evented from 'dojo/Evented';
import arcgisUtils from 'esri/arcgis/utils';
import Logger from 'babel/utils/logging/Logger';

var internals = {
  logger: new Logger({source: 'Data'})
};

export default internals.Data = class Data extends Evented {

  constructor(options) {
    super(options);

    let defaults = {};

    this._settings = $.extend(true, {}, defaults, options);
  }

  init() {
    internals.logger.logMessage({
      debugOnly: true,
      type: 'status',
github Esri / storymap-crowdsource / src / app / storymaps / utils / helper / Helper.babel.js View on Github external
import $ from 'jquery';
import Evented from 'dojo/Evented';
import Logger from 'babel/utils/logging/Logger';
import Icons from 'babel/utils/icons/Icons';

var internals = {
  logger: new Logger({source: 'Helper'})
};

export default internals.Helper = class Helper extends Evented {

  constructor(options) {
    super(options);

    let defaults = {};

    this._settings = $.extend(true, {}, defaults, options);
  }

  init() {
    let icons = this._icons = new Icons();

    internals.logger.logMessage({
github Esri / storymap-crowdsource / src / app / storymaps / utils / icons / Icons.babel.js View on Github external
import $ from 'jquery';
import Logger from 'babel/utils/logging/Logger';
import Evented from 'dojo/Evented';
import IconsHtml from 'text!storymaps/utils/icons/Icons.html';

var internals = {
  logger: new Logger({source: 'Icons'})
};

export default internals.Icons = class Icons extends Evented {

  constructor(options) {
    super(options);

    let defaults = {};

    this._settings = $.extend(true, {}, defaults, options);
  }

  init() {
    internals.logger.logMessage({
      debugOnly: true,
      type: 'status',
github Esri / storymap-crowdsource / src / app / storymaps / ui / header / HeaderController.babel.js View on Github external
import $ from 'jquery';
import Evented from 'dojo/Evented';
import Logger from 'babel/utils/logging/Logger';
import Icons from 'babel/utils/icons/Icons';

var internals = {
  logger: new Logger({source: 'HeaderController'})
};

export default internals.HeaderController = class HeaderController extends Evented {

  constructor(options) {
    super(options);

    let defaults = {};

    this._settings = $.extend(true, {}, defaults, options);
  }

  init() {
    internals.logger.logMessage({
      debugOnly: true,
      type: 'status',
github Esri / storymap-crowdsource / src / app / utils / arcgis / items / Item.babel.js View on Github external
import Deferred from 'dojo/Deferred';
import lang from 'dojo/_base/lang';
import esriRequest from 'esri/request';
import IdentityManager from 'esri/IdentityManager';
import URI from 'lib/urijs/src/URI';
import AppStore from 'babel/store/AppStore';
import Logger from 'babel/utils/logging/Logger';
import crowdsourceVersionUpdate from 'babel/utils/appData/CrowdsourceVersionUpdate';
import ArcgisActions from 'babel/actions/ArcgisActions';
import AppActions from 'babel/actions/AppActions';
import ModeActions from 'babel/actions/ModeActions';
import viewerText from 'i18n!translations/viewer/nls/template';
import builderText from 'mode!isBuilder?i18n!translations/builder/nls/template';
import 'babel/utils/helper/strings/StringUtils';

const _logger = new Logger({source: 'ArcGIS - Item'});

const _onError = function onError(err) {
  _logger.logMessage({
    type: 'error',
    error: err
  });
};

const _onStatus = function onStatus(message,debugOnly) {
  _logger.logMessage({
    type: 'status',
    debugOnly,
    message
  });
};
github Esri / storymap-crowdsource / src / app / controllers / fromScratch / StoryCreator.babel.js View on Github external
import UrlUtils from 'esri/urlUtils';
import Logger from 'babel/utils/logging/Logger';
import Validator from 'babel/utils/validations/Validator';
import AppStore from 'babel/store/AppStore';
import ConfigActions from 'babel/actions/ConfigActions';
import ModeActions from 'babel/actions/ModeActions';
import ItemActions from 'babel/actions/ItemActions';
import SettingsActions from 'babel/actions/SettingsActions';
import BuilderActions from 'babel/actions/BuilderActions';
import AppActions from 'babel/actions/AppActions';
import UserActions from 'babel/actions/UserActions';
import ArcgisItem from 'babel/utils/arcgis/items/Item';
import componentNames from 'babel/constants/componentNames/ComponentNames';
import builderText from 'i18n!translations/builder/nls/template';

const _logger = new Logger({source: 'StoryCreator'});

const _onError = function onError(error) {
  _logger.logMessage({
    type: 'error',
    error
  });
};

const _onStatus = function onStatus(message,debugOnly) {
  _logger.logMessage({
    type: 'status',
    debugOnly,
    message
  });
};
github Esri / storymap-crowdsource / src / app / utils / validations / Validator.babel.js View on Github external
import $ from 'jquery';
import Deferred from 'dojo/Deferred';
import Logger from 'babel/utils/logging/Logger';
import BasicRules from 'babel/utils/validations/rules/BasicRules';
import PatternRules from 'babel/utils/validations/rules/pattern/PatternRules';
import ArcgisBasicRules from 'babel/utils/validations/rules/arcgis/ArcgisBasicRules';
import LocationRules from 'babel/utils/validations/rules/arcgis/LocationRules';
import ItemRules from 'mode!isBuilder?babel/utils/validations/rules/arcgis/ItemRules';
import PortalRules from 'mode!isBuilder?babel/utils/validations/rules/arcgis/PortalRules';

const _logger = new Logger({source: 'Validator'});

const _onError = function onError(err) {
  _logger.logMessage({
    type: 'error',
    error: err
  });
};

const _rules = $.extend(true,{},
  BasicRules,
  PatternRules,
  ArcgisBasicRules,
  LocationRules,
  ItemRules,
  PortalRules
);