• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript logger.ILogger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript logger.LoggerService类代码示例发布时间:2022-05-25
下一篇:
TypeScript entities.schemaCreate函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap