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