當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript logger.ILogger類代碼示例

本文整理匯總了TypeScript中helpers/logger/logger.ILogger的典型用法代碼示例。如果您正苦於以下問題:TypeScript ILogger類的具體用法?TypeScript ILogger怎麽用?TypeScript ILogger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ILogger類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: return

    return (exception: any, cause: any) => {
      $delegate(exception, cause);

      let logger: ILogger = $injector.get('logger').getLogger('exceptionHandler');
      let $analytics: angulartics.IAnalyticsService = $injector.get('$analytics');
      let message: string = exception + (cause ? ' (' + cause + ')' : '');

      logger.error(message);
      $analytics.eventTrack('Exception', { category: 'error', value: message });
    };
開發者ID:sinedied,項目名稱:hadra-trance-festival,代碼行數:10,代碼來源:main.config.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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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


注:本文中的helpers/logger/logger.ILogger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。