本文整理汇总了TypeScript中Debug.disable函数的典型用法代码示例。如果您正苦于以下问题:TypeScript disable函数的具体用法?TypeScript disable怎么用?TypeScript disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disable函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
hooks.afterEach(function() {
log.restore();
debug.disable();
});
示例2:
export const setDebugScopes = scopes => {
debug.disable()
debug.enable(scopes)
}
示例3: debug2
import * as debug1 from "debug";
/*tslint:disable-next-line:no-duplicate-imports*/
import debug2 from 'debug';
const log2: debug1.Debugger = debug2("DefinitelyTyped:log");
log2("Just text");
log2("Formatted test (%d arg)", 1);
log2("Formatted %s (%d args)", "test", 2);
debug1.disable();
debug1.enable("DefinitelyTyped:*");
const log: debug1.Debugger = debug1("DefinitelyTyped:log");
log("Just text");
log("Formatted test (%d arg)", 1);
log("Formatted %s (%d args)", "test", 2);
log("Enabled?: %s", debug1.enabled("DefinitelyTyped:log"));
log("Name Enabled: %s", debug1.names.some(name => name.test("DefinitelyTyped:log")));
log("Namespace: %s", log.namespace);
const error: debug1.Debugger = debug1("DefinitelyTyped:error");
error.log = console.error.bind(console);
error("This should be printed to stderr");
const extendedLog: debug1.Debugger = log.extend('extended');
extendedLog("Testing this is also an IDebugger.");
const extendedWithCustomDelimiter: debug1.Debugger = log.extend('with-delim', '.');
extendedWithCustomDelimiter("Testing this is an IDebugger, too.");