当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ILogger.log方法代码示例

本文整理汇总了TypeScript中helpers/logger/logger.ILogger.log方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ILogger.log方法的具体用法?TypeScript ILogger.log怎么用?TypeScript ILogger.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helpers/logger/logger.ILogger的用法示例。


在下文中一共展示了ILogger.log方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: inject

  /**
   * Injects the specified context into the given REST API.
   * The REST API should be formatted like "/api/users/:userId".
   * Any fragment from the REST API starting with ":" will then be replaced by a property from the context with
   * the same name, i.e. for "/api/users/:userId" and a context object "{ userId: 123 }", the resulting URL will
   * be "/api/users/123".
   * @param {!string} restApi The REST API to fill will context values.
   * @param {Object} context The context to use.
   * @return {string} The ready-to-use REST API to call.
   */
  inject(restApi: string, context?: any): string {
    this.logger.log('Injecting context in: ' + restApi);

    if (!context) {
      throw 'inject: context must be defined';
    }

    // Search for context properties to inject
    let properties = restApi.match(/(:\w+)/g);

    angular.forEach(properties, (property: string) => {
      let contextVar = property.substring(1);
      let contextValue = context[contextVar];

      if (contextValue !== undefined) {
        contextValue = encodeURIComponent(contextValue);
        restApi = restApi.replace(property, contextValue);
        this.logger.log('Injected ' + contextValue + ' for ' + property);
      } else {
        throw 'inject: context.' + contextVar + ' expected but undefined';
      }
    });

    this.logger.log('Resulting REST API: ' + restApi);

    return restApi;
  }
开发者ID:angular-starter-kit,项目名称:generator-angular-pro,代码行数:37,代码来源:context.service.ts

示例2:

          _.each(artist.sets, (set: Set) => {
            let notificationExist = _.find(notifications, notification => JSON.parse(notification.data).id === set.id);
            this.logger.log('exist: ' + notificationExist + ' || ' + set.id);

            // Use "real" set date to use setup notification based on device local date
            let setNotificationDate = this.moment(set.start).subtract(NOTIFY_BEFORE_MIN, 'minutes');
            let inFuture = setNotificationDate.isAfter(now);
            this.logger.log('inFuture: ' + inFuture + ' || ' + set.start);

            if (set.start && !notificationExist && inFuture) {
              this.logger.log(`Adding notification for artist: ${id}, set: ${set.start}`);

              this.$cordovaLocalNotification.schedule({
                id: '' + this.getId(),  // ID needs to be a string convertible to an integer
                smallicon: 'res://drawable/ic_notification_hadra',
                icon: 'res://drawable/ic_notification_hadra',
                color: this.config.notificationColor,
                led: this.config.notificationColor,
                text: this.gettextCatalog.getString('{{name}} {{type}} set starts in 10 minutes on {{scene}} floor!', {
                  name: set.artist.name,
                  type: set.type,
                  scene: set.scene.name
                }),
                data: Set.getSerializableCopyWithId(set),
                at: setNotificationDate.toDate(),
              });

            }
          });
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:29,代码来源:notification.service.ts

示例3: onTrigger

  private onTrigger(event: any, notification: any) {
    this.logger.log('notification triggered');

    if (this.$rootScope['foreground']) {
      this.toastService.show(notification.text);
    }
  }
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:7,代码来源:notification.service.ts

示例4: constructor

  constructor($scope: ng.IScope,
              $stateParams: angular.ui.IStateParamsService,
              private $cordovaInAppBrowser: any,
              private moment: moment.MomentStatic,
              private gettextCatalog: angular.gettext.gettextCatalog,
              logger: LoggerService,
              private festivalService: FestivalService,
              private playerService: PlayerService,
              private favoritesService: FavoritesService,
              private toastService: ToastService) {

    this.logger = logger.getLogger('artist');
    this.logger.log('init');

    this.noBio = gettextCatalog.getString('No bio');
    this.favorites = this.favoritesService.favorites;

    // Init each time, because of view cache
    $scope.$on('$ionicView.beforeEnter', () => {
      let artistId = $stateParams['artistId'];
      this.logger.log('artistId', artistId);

      this.artist = this.festivalService.festival.artistById[artistId];
    });
  }
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:25,代码来源:artist.controller.ts

示例5: constructor

  constructor(logger: LoggerService,
              config: IApplicationConfig) {

    this.logger = logger.getLogger('about');
    this.version = config.version;

    this.logger.log('init');
  }
开发者ID:angular-starter-kit,项目名称:generator-angular-pro,代码行数:8,代码来源:about.controller.ts

示例6: encodeURIComponent

    angular.forEach(properties, (property: string) => {
      let contextVar = property.substring(1);
      let contextValue = context[contextVar];

      if (contextValue !== undefined) {
        contextValue = encodeURIComponent(contextValue);
        restApi = restApi.replace(property, contextValue);
        this.logger.log('Injected ' + contextValue + ' for ' + property);
      } else {
        throw 'inject: context.' + contextVar + ' expected but undefined';
      }
    });
开发者ID:angular-starter-kit,项目名称:generator-angular-pro,代码行数:12,代码来源:context.service.ts

示例7: constructor

  constructor(private $state: ng.ui.IStateService,
              $locale: ng.ILocaleService,
              private _: _.LoDashStatic,
              config: IApplicationConfig,
              logger: LoggerService) {

    this.currentLocale = $locale;
    this.logger = logger.getLogger('shell');
    this.languages = config.supportedLanguages;
    this.menuHidden = true;

    this.logger.log('init');
  }
开发者ID:sinedied,项目名称:festival-editor,代码行数:13,代码来源:shell.controller.ts

示例8: constructor

  constructor($scope: ng.IScope,
              $stateParams: angular.ui.IStateParamsService,
              private $cordovaInAppBrowser: any,
              festivalService: FestivalService,
              logger: LoggerService) {

    this.logger = logger.getLogger('infoController');
    this.logger.log('init');

    // Init each time, because of view cache
    $scope.$on('$ionicView.beforeEnter', () => {
      let infoId = $stateParams['infoId'];
      this.logger.log('infoId', infoId);

      this.info = festivalService.festival.infos[infoId];
    });
  }
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:17,代码来源:info.controller.ts

示例9: constructor

  constructor(private $state: ng.ui.IStateService,
              logger: LoggerService) {

    this.logger = logger.getLogger('shell');
    this.logger.log('init');
  }
开发者ID:sinedied,项目名称:hadra-trance-festival,代码行数:6,代码来源:shell.controller.ts


注:本文中的helpers/logger/logger.ILogger.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。