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


TypeScript logging.logger類代碼示例

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


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

示例1: set_initial_range

 set_initial_range(): void {
   // check for good values for ranges before setting initial range
   let good_vals = true
   const {x_ranges, y_ranges} = this.frame
   const xrs: {[key: string]: Interval} = {}
   const yrs: {[key: string]: Interval} = {}
   for (const name in x_ranges) {
     const {start, end} = x_ranges[name]
     if (start == null || end == null || isStrictNaN(start + end)) {
       good_vals = false
       break
     }
     xrs[name] = {start, end}
   }
   if (good_vals) {
     for (const name in y_ranges) {
       const {start, end} = y_ranges[name]
       if (start == null || end == null || isStrictNaN(start + end)) {
         good_vals = false
         break
       }
       yrs[name] = {start, end}
     }
   }
   if (good_vals) {
     this._initial_state_info.range = {xrs, yrs}
     logger.debug("initial ranges set")
   } else
     logger.warn('could not set initial ranges')
 }
開發者ID:gully,項目名稱:bokeh,代碼行數:30,代碼來源:plot_canvas.ts

示例2: set_initial_range

 set_initial_range() {
   // check for good values for ranges before setting initial range
   let good_vals = true;
   const xrs = {};
   const yrs = {};
   for (const name in this.frame.x_ranges) {
     const rng = this.frame.x_ranges[name];
     if ((rng.start == null) || (rng.end == null) || isStrictNaN(rng.start + rng.end)) {
       good_vals = false;
       break;
     }
     xrs[name] = { start: rng.start, end: rng.end };
   }
   if (good_vals) {
     for (const name in this.frame.y_ranges) {
       const rng = this.frame.y_ranges[name];
       if ((rng.start == null) || (rng.end == null) || isStrictNaN(rng.start + rng.end)) {
         good_vals = false;
         break;
       }
       yrs[name] = { start: rng.start, end: rng.end };
     }
   }
   if (good_vals) {
     this._initial_state_info.range = this.initial_range_info = {xrs, yrs};
     return logger.debug("initial ranges set");
   } else {
     return logger.warn('could not set initial ranges');
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:30,代碼來源:plot_canvas.ts

示例3: return

 return () => {
   if (this.retries[i] > 0) {
     logger.trace(`ImageURL failed to load ${this._url[i]} image, retrying in ${retry_timeout} ms`);
     setTimeout(() => img.src = this._url[i], retry_timeout);
   } else {
     logger.warn(`ImageURL unable to load ${this._url[i]} image after ${retry_attempts} retries`);
   }
   return this.retries[i] -= 1;
 };
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:9,代碼來源:image_url.ts

示例4: compute_indices

 compute_indices(_source: DataSource): number[] | null {
   if (this.indices != null && this.indices.length >= 0) {
     if (all(this.indices, isInteger))
       return this.indices
     else {
       logger.warn(`IndexFilter ${this.id}: indices should be array of integers, defaulting to no filtering`)
       return null
     }
   } else {
     logger.warn(`IndexFilter ${this.id}: indices was not set, defaulting to no filtering`)
     return null
   }
 }
開發者ID:Zyell,項目名稱:bokeh,代碼行數:13,代碼來源:index_filter.ts

示例5: initialize

  initialize(): void {
    super.initialize()

    // Validate data_sources match
    const data_source_validation = this._check_data_sources_on_renderers()
    if (!data_source_validation)
      logger.error("Non matching data sources on legend item renderers")

    // Validate label in data_source
    const field_validation = this._check_field_label_on_data_source()
    if (!field_validation)
      logger.error(`Bad column name on label: ${this.label}`)
  }
開發者ID:gully,項目名稱:bokeh,代碼行數:13,代碼來源:legend_item.ts

示例6: compute_indices

 compute_indices(_source): any {
   if ((this.indices != null ? this.indices.length : undefined) >= 0) {
     if (all(this.indices, isInteger)) {
       return this.indices;
     } else {
       logger.warn(`IndexFilter ${this.id}: indices should be array of integers, defaulting to no filtering`);
       return null;
     }
   } else {
     logger.warn(`IndexFilter ${this.id}: indices was not set, defaulting to no filtering`);
     return null;
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:13,代碼來源:index_filter.ts

示例7: compute_indices

 compute_indices(source): any {
   const column = source.get_column(this.column_name);
   if ((column == null)) {
     logger.warn("group filter: groupby column not found in data source");
     return null;
   } else {
     this.indices = (range(0, source.get_length()).filter((i) => column[i] === this.group));
     if (this.indices.length === 0) {
       logger.warn(`group filter: group '${this.group}' did not match any values in column '${this.column_name}'`);
     }
     return this.indices;
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:13,代碼來源:group_filter.ts

示例8: compute_indices

 compute_indices(_source): any {
   if ((this.filter != null ? this.filter.length : undefined) >= 0) {
     if (all(this.filter, isBoolean)) {
       return (range(0, this.filter.length).filter((i) => this.filter[i] === true));
     } else if (all(this.filter, isInteger)) {
       return this.filter;
     } else {
       logger.warn(`Filter ${this.id}: filter should either be array of only booleans or only integers, defaulting to no filtering`);
       return null;
     }
   } else {
     logger.warn(`Filter ${this.id}: filter was not set to be an array, defaulting to no filtering`);
     return null;
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:15,代碼來源:filter.ts

示例9: compute_indices

 compute_indices(_source: DataSource): number[] | null {
   const filter = this.filter
   if (filter != null && filter.length >= 0) {
     if (isArrayOf(filter, isBoolean)) {
       return range(0, filter.length).filter((i) => filter[i] === true)
     }
     if (isArrayOf(filter, isInteger)) {
       return filter
     }
     logger.warn(`Filter ${this.id}: filter should either be array of only booleans or only integers, defaulting to no filtering`)
     return null
   } else {
     logger.warn(`Filter ${this.id}: filter was not set to be an array, defaulting to no filtering`)
     return null
   }
 }
開發者ID:Zyell,項目名稱:bokeh,代碼行數:16,代碼來源:filter.ts

示例10: _init_tools

  _init_tools() {
    for (const tool of this.tools) {
      if (tool instanceof InspectTool) {
        if (!any(this.inspectors, t => t.id === tool.id))
          this.inspectors = this.inspectors.concat([tool]);
      } else if (tool instanceof HelpTool) {
        if (!any(this.help, t => t.id === tool.id))
          this.help = this.help.concat([tool]);
      } else if (tool instanceof ActionTool) {
        if (!any(this.actions, t => t.id === tool.id))
          this.actions = this.actions.concat([tool]);
      } else if (tool instanceof GestureTool) {
        let event_types = tool.event_type
        let multi = true
        if (typeof event_types === "string") {
          event_types = [event_types]
          multi = false
        }

        for (let et of event_types) {
          if (!(et in this.gestures)) {
            logger.warn(`Toolbar: unknown event type '${et}' for tool: ${tool.type} (${tool.id})`)
            continue
          }

          if (multi)
            et = "multi"

          if (!any(this.gestures[et].tools, t => t.id === tool.id))
            this.gestures[et].tools = this.gestures[et].tools.concat([tool]);
        }
      }
    }
  }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:34,代碼來源:toolbar_box.ts


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