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


TypeScript Log.info方法代码示例

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


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

示例1: onInit

  @override
  public async onInit(): Promise<void> {
    Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);

    // Added to handle possible changes on the existence of placeholders
    // this.context.placeholderProvider.changedEvent.add(this, this._renderPlaceHolders);
    // this.context.application._layoutChangedEvent.add(this, this._layoutChanged);
    
    // Retrieve the menu items from taxonomy
    Log.info(LOG_SOURCE, `Creating instance of SPTermStore.SPTermStoreService`);
    Log.info(LOG_SOURCE, `spHttpClient: ${this.context.spHttpClient}`);
    Log.info(LOG_SOURCE, `siteAbsoluteUrl: ${this.context.pageContext.web.absoluteUrl}`);
    let termStoreService: SPTermStore.SPTermStoreService = new SPTermStore.SPTermStoreService({
      spHttpClient: this.context.spHttpClient,
      siteAbsoluteUrl: this.context.pageContext.web.absoluteUrl,
    });

    Log.info(LOG_SOURCE, `SourceTermSetName: ${this.properties.SourceTermSetName}`);
    this._bottomMenuItems = await termStoreService.getTermsFromTermSetAsync(this.properties.SourceTermSetName);
        
    // Call render method for generating the needed html elements
    this._renderPlaceHolders();

    return Promise.resolve<void>();
  }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:25,代码来源:YammerFooterApplicationCustomizer.ts

示例2: onInit

 @override
 public onInit(): Promise<void> {
   Log.info(LOG_SOURCE, 'Activated TaskPriorityFieldCustomizer with properties:');
   Log.info(LOG_SOURCE, JSON.stringify(this.properties, undefined, 2));
   Log.info(LOG_SOURCE, `The following string should be equal: "TaskPriority" and "${strings.Title}"`);
   return Promise.resolve<void>();
 }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:7,代码来源:TaskPriorityFieldCustomizer.ts

示例3: onInit

 @override
 public onInit(): Promise<void> {
   // Add your custom initialization to this method.  The framework will wait
   // for the returned promise to resolve before firing any BaseFieldCustomizer events.
   Log.info(LOG_SOURCE, 'Activated CustomColorFieldFieldCustomizer with properties:');
   Log.info(LOG_SOURCE, JSON.stringify(this.properties, undefined, 2));
   Log.info(LOG_SOURCE, `The following string should be equal: "CustomColorFieldFieldCustomizer" and "${strings.Title}"`);
   return Promise.resolve();
 }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:9,代码来源:CustomColorFieldFieldCustomizer.ts

示例4: getLookupOptions

function getLookupOptions(state: Array<LookupOptions>, action) {

    let newstate = _.clone(state);
    newstate.push(action.payload.lookupOptions);
    Log.info("getLookupOptions", "Added Header Record");
    return newstate;
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例5: _renderPlaceHolders

  private _renderPlaceHolders(): void {
    
    Log.info(LOG_SOURCE, `Available placeholders:  ${this.context.placeholderProvider.placeholderNames.map(name => PlaceholderName[name]).join(', ')}`);

    // Handling the bottom placeholder
    if (!this._bottomPlaceholder) {
      this._bottomPlaceholder =
        this.context.placeholderProvider.tryCreateContent(
          PlaceholderName.Bottom,
          { onDispose: this._onDispose });

      // The extension should not assume that the expected placeholder is available.
      if (!this._bottomPlaceholder) {
        console.error('The expected placeholder (Bottom) was not found.');
        return;
      }

      const withinPages: boolean = this.context.pageContext.listItem != null;

      if (this.properties && withinPages) {
        const element: React.ReactElement<IYammerFooterBarProps> = React.createElement(
          YammerFooterBar,
          {
            context: this.context,
            sourceTermSetName: this.properties.SourceTermSetName,
            menuItems: this._bottomMenuItems
          }
        );
    
        ReactDom.render(element, this._bottomPlaceholder.domElement);
      }
    }
  }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:33,代码来源:YammerFooterApplicationCustomizer.ts

示例6: SubscribeToStatusChangeForUser

 public async SubscribeToStatusChangeForUser(userEmail: string, userDisplayName: string,
     handler: (newStatus: string, oldStatus: string, displayName: string) => void): Promise<boolean> {
     if (!userEmail || !handler) {
         return false;
     }
     userDisplayName = userDisplayName.replace("(...)", "");
     const skypeApp: any = await this.Initialize();
     const personsAndGroupsManager: any = skypeApp.personsAndGroupsManager;
     const mePerson: any = personsAndGroupsManager.mePerson;
     if (SkypeForBusinessCommunicationService.webPartContext().pageContext.user.email === userEmail) {
         Log.info(Constants.ErrorCategory, `Bypassed skype subscription for current user ${userEmail}`);
         handler("Online", undefined, mePerson.displayName());
     } else {
         const query: any = personsAndGroupsManager.createPersonSearchQuery();
         query.text(userEmail);
         query.limit(1);
         await query.getMore();
         query.results().forEach((result) => {
             const person: any = result.result;
             if (person.id().indexOf(userEmail) !== -1) {
                 handler("Offline", undefined, userDisplayName);
                 person.status.changed((newStatus, reason, oldStatus) => {
                     Log.info(Constants.ErrorCategory,
                         `${person.displayName()} status changed from ${oldStatus} to ${newStatus} because ${reason}`);
                     handler(newStatus, oldStatus, person.displayName());
                 });
                 person.status.subscribe();
             }
         });
     }
     return true;
 }
开发者ID:,项目名称:,代码行数:32,代码来源:

示例7: onRefreshCommand

  @override
  public onRefreshCommand(event: IListViewCommandSetRefreshEventParameters): void {
    event.visible = true; // assume true by default

    if (this.properties.disabledCommandIds) {
      if (this.properties.disabledCommandIds.indexOf(event.commandId) >= 0) {
        Log.info(LOG_SOURCE, 'Hiding command ' + event.commandId);
        event.visible = false;
      }
    }

    if (event.selectedRows.length <= 0) {
      Log.info(LOG_SOURCE, 'Hiding command ' + event.commandId);
      event.visible = false;
    }
  }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:16,代码来源:FilesSizeCommandSet.ts

示例8: onRender

  @override
  public onRender(): void {
    let message: string = this.properties.testMessage;
    if (!message) {
      message = '(No properties were provided.)';
    }

    let html: string = '';
    html+= `
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-100712891-1', 'auto');
      ga('send', 'pageview');`;
    let head: any = document.getElementsByTagName("head")[0] || document.documentElement,
    script = document.createElement("script");
    script.type = "text/javascript";

    try {
        console.log('Append child');
        script.appendChild(document.createTextNode(html));
    } 
    catch (e) {
        console.log('Append child catch');
        script.text = html;
    }
    head.insertBefore(script, head.firstChild);
    head.removeChild(script);

    Log.info(LOG_SOURCE,`Hello from ${strings.Title}:\n\n${message}`);
  }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:33,代码来源:AnalyticsApplicationCustomizer.ts

示例9: onInit

  @override
  public onInit(): Promise<void> {
    Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);

    // Added to handle possible changes on the existence of placeholders
    this.context.placeholderProvider.changedEvent.add(this, this._renderPlaceHolders);
    this._lastQueryDate = moment();
    this._connectSocket(this.properties.WebhooksSocketServer);
    return Promise.resolve();
  }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:10,代码来源:WebhooksToastNotificationsApplicationCustomizer.ts

示例10: onInit

  @override
  public onInit(): Promise<void> {
    Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);

    // Added to handle possible changes on the existence of placeholders
    this.context.placeholderProvider.changedEvent.add(this, this._renderPlaceHolders);

    // Call render method for generating the needed html elements
    this._renderPlaceHolders();
    return Promise.resolve<void>();
  }
开发者ID:AdrianDiaz81,项目名称:sp-dev-fx-extensions,代码行数:11,代码来源:HelloWorldApplicationCustomizer.ts


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