本文整理汇总了TypeScript中core/logging.set_log_level函数的典型用法代码示例。如果您正苦于以下问题:TypeScript set_log_level函数的具体用法?TypeScript set_log_level怎么用?TypeScript set_log_level使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_log_level函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should alert if column lengths are inconsistent", () => {
set_log_level("info")
const r0 = new ColumnDataSource({data: {foo: [1], bar: [1,2]}})
const out0 = stderrTrap(() => r0.get_length())
expect(out0).to.be.equal("[bokeh] data source has columns of inconsistent lengths\n")
const r1 = new ColumnDataSource({data: {foo: [1], bar: [1,2], baz: [1]}})
const out1 = stderrTrap(() => r1.get_length())
expect(out1).to.be.equal("[bokeh] data source has columns of inconsistent lengths\n")
})
示例2: it
it("checks for versions matching", () => {
const d = new Document()
expect(d.roots().length).to.equal(0)
const root1 = new SomeModel()
d.add_root(root1)
expect(d.roots().length).to.equal(1)
d.set_title("Foo")
const old_log_level = logging.logger.level.name
logging.set_log_level("warn")
const json = d.to_json_string()
const parsed = JSON.parse(json)
parsed.version = `${js_version}`
const out0 = stderrTrap(() => Document.from_json_string(JSON.stringify(parsed)))
expect(out0).to.be.equal("")
parsed.version = "0.0.1"
const out1 = stderrTrap(() => Document.from_json_string(JSON.stringify(parsed)))
expect(out1).to.be.equal(`[bokeh] JS/Python version mismatch\n[bokeh] Library versions: JS (${js_version}) / Python (${parsed.version})\n`)
parsed.version = `${js_version}rc123`
const out2 = stderrTrap(() => Document.from_json_string(JSON.stringify(parsed)))
expect(out2).to.be.equal(`[bokeh] JS/Python version mismatch\n[bokeh] Library versions: JS (${js_version}) / Python (${parsed.version})\n`)
parsed.version = `${js_version}dev123`
const out3 = stderrTrap(() => Document.from_json_string(JSON.stringify(parsed)))
expect(out3).to.be.equal(`[bokeh] JS/Python version mismatch\n[bokeh] Library versions: JS (${js_version}) / Python (${parsed.version})\n`)
parsed.version = `${js_version}-foo`
const out4 = stderrTrap(() => Document.from_json_string(JSON.stringify(parsed)))
expect(out4).to.be.equal("")
parsed.version = `${js_version}rc123-foo`
const out5 = stderrTrap(() => Document.from_json_string(JSON.stringify(parsed)))
expect(out5).to.be.equal("")
parsed.version = `${js_version}dev123-bar`
const out6 = stderrTrap(() => Document.from_json_string(JSON.stringify(parsed)))
expect(out6).to.be.equal("")
// need to reset old log level
logging.set_log_level(old_log_level)
})
示例3: stdoutTrap
const out = stdoutTrap(() => set_log_level("bad"))