本文整理匯總了TypeScript中lighthouse-logger.setLevel函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript setLevel函數的具體用法?TypeScript setLevel怎麽用?TypeScript setLevel使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了setLevel函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeEach
beforeEach(() => {
log.setLevel('error');
});
示例2: afterEach
afterEach(() => {
log.setLevel('');
});
示例3: require
Commands.ListTraceCategories();
}
const url = cliFlags._[0];
let config: Object|null = null;
if (cliFlags.configPath) {
// Resolve the config file path relative to where cli was called.
cliFlags.configPath = path.resolve(process.cwd(), cliFlags.configPath);
config = require(cliFlags.configPath);
} else if (cliFlags.perf) {
config = perfOnlyConfig;
}
// set logging preferences
cliFlags.logLevel = 'info';
if (cliFlags.verbose) {
cliFlags.logLevel = 'verbose';
} else if (cliFlags.quiet) {
cliFlags.logLevel = 'silent';
}
log.setLevel(cliFlags.logLevel);
if (cliFlags.output === Printer.OutputMode[Printer.OutputMode.json] && !cliFlags.outputPath) {
cliFlags.outputPath = 'stdout';
}
export function run() {
return runLighthouse(url, cliFlags, config);
}