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


TypeScript Log.error方法代碼示例

本文整理匯總了TypeScript中@microsoft/sp-core-library.Log.error方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Log.error方法的具體用法?TypeScript Log.error怎麽用?TypeScript Log.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@microsoft/sp-core-library.Log的用法示例。


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

示例1: resolve

 return jQuery.getScript("https://swx.cdn.skype.com/shared/v/1.2.36/SkypeBootstrap.min.js").then(() => {
     const config: {apiKey: string, apiKeyCC: string} = {
         apiKey: "a42fcebd-5b43-4b89-a065-74450fb91255", // sdk
         apiKeyCC: "9c967f6b-a846-4df2-b43d-5167e47d81e1", // sdk+ui
     };
     if (currentConfiguration && currentConfiguration.ClientId) {
         Skype.initialize({ apiKey: config.apiKey }, (api) => {
             const app: any = new api.application();
             app.signInManager.signIn ({
                 client_id: currentConfiguration.ClientId,
                 cors: true,
                 origins: ["https://webdir.online.lync.com/autodiscover/autodiscoverservice.svc/root"],
                 redirect_uri: currentConfiguration.RedirectUri,
             }).then(() => {
                 resolve(app);
             }, (err: any) => {
                 Log.error(Constants.ErrorCategory, new Error(`cannot sign in ${err}`));
                 location.assign("https://login.microsoftonline.com/common/oauth2/authorize?response_type=token" +
                     "&client_id=" + currentConfiguration.ClientId +
                     "&redirect_uri=" + location.href +
                     "&resource=https://webdir.online.lync.com");
                 reject(err);
             });
         });
     } else {
         Log.error(Constants.ErrorCategory, new Error(`configuration missing for skype presence service`));
     }
 });
開發者ID:,項目名稱:,代碼行數:28,代碼來源:

示例2: Error

 }, (err: any) => {
     Log.error(Constants.ErrorCategory, new Error(`cannot sign in ${err}`));
     location.assign("https://login.microsoftonline.com/common/oauth2/authorize?response_type=token" +
         "&client_id=" + currentConfiguration.ClientId +
         "&redirect_uri=" + location.href +
         "&resource=https://webdir.online.lync.com");
     reject(err);
 });
開發者ID:,項目名稱:,代碼行數:8,代碼來源:

示例3: onInit

  @override
  public onInit(): Promise<void> {
    Log._initialize(new ConsoleLogHandler((window as any).LOG_LEVEL || LogLevel.Error));
    Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);

    if (!this.properties.siteUrl ||
      !this.properties.listName) {
      const e: Error = new Error('Missing required configuration parameters');
      Log.error(LOG_SOURCE, e);
      return Promise.reject(e);
    }

    return Promise.resolve<void>();
  }
開發者ID:AdrianDiaz81,項目名稱:sp-dev-fx-extensions,代碼行數:14,代碼來源:AnnouncementsApplicationCustomizer.ts

示例4: onRender

  @override
  public onRender(): void {
    const header: Placeholder = this.context.placeholders.tryAttach('PageHeader', {
      onDispose: this._onDispose
    });
    if (!header) {
      Log.error(LOG_SOURCE, new Error('Could not find placeholder PageHeader'));
      return;
    }

    const elem: React.ReactElement<IAnnouncementsProps> = React.createElement(Announcements, {
      siteUrl: this.properties.siteUrl,
      listName: this.properties.listName,
      spHttpClient: this.context.spHttpClient
    });
    ReactDOM.render(elem, header.domElement);
  }
開發者ID:AdrianDiaz81,項目名稱:sp-dev-fx-extensions,代碼行數:17,代碼來源:AnnouncementsApplicationCustomizer.ts

示例5: onRenderCell

  @override
  public onRenderCell(event: IFieldCustomizerCellEventParameters): void {
    event.cellDiv.parentElement.classList.add(styles.ConditionalFormatting);

    event.cellDiv.innerText = CellFormatter.renderAsText(this.context.column, event.cellValue);

    let midStart: number = this.properties.midStart;
    let midEnd: number = this.properties.midEnd;

    if (!midStart && !midEnd) {
      Log.error(LOG_SOURCE, new Error('Field customizer configuration missing. midStart or midEnd parameter must be specified'));
      return;
    }
    else {
      if (midStart && !midEnd) {
        Log.verbose(LOG_SOURCE, `midEnd not specified. Setting to midStart:${midStart}`);
        midEnd = midStart;
      }
      else if (!midStart && midEnd) {
        Log.verbose(LOG_SOURCE, `midStart not specified. Setting to midEnd:${midEnd}`);
        midStart = midEnd;
      }
    }

    let value: number = parseInt(event.cellValue);
    if (isNaN(value)) {
      Log.info(LOG_SOURCE, `'${event.cellValue}' is not a number. Aborting conditional formatting`);
      return;
    }

    if (value < midStart) {
      event.cellDiv.parentElement.classList.add(styles.min);
    }
    else if (value >= midStart && value <= midEnd) {
      event.cellDiv.parentElement.classList.add(styles.mid);
    }
    else if (value > midEnd) {
      event.cellDiv.parentElement.classList.add(styles.max);      
    }
  }
開發者ID:AdrianDiaz81,項目名稱:sp-dev-fx-extensions,代碼行數:40,代碼來源:ConditionalFormattingFieldCustomizer.ts

示例6:

 error: (error: any): void => {
   Log.error(LOG_SOURCE, error);
 }
開發者ID:AdrianDiaz81,項目名稱:sp-dev-fx-extensions,代碼行數:3,代碼來源:WeatherFieldCustomizer.ts

示例7:

 .catch((error: any): void => {
   Log.error(LOG_SOURCE, error);
   this.safeLog(error);
 });
開發者ID:AdrianDiaz81,項目名稱:sp-dev-fx-extensions,代碼行數:4,代碼來源:SpfxCloneCommandSet.ts


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