diff --git a/lib/cli/cli.js b/lib/cli/cli.js index f6a7d7e94..67f063830 100644 --- a/lib/cli/cli.js +++ b/lib/cli/cli.js @@ -1978,6 +1978,11 @@ export async function parseCommandLine() { .option('name', { describe: 'Give your test a name.' }) + .option('logLevel', { + type: 'string', + choices: ['trace', 'verbose', 'debug', 'info', 'warning', 'error'], + describe: 'Manually set the min log level' + }) .option('open', { alias: ['o', 'view'], describe: diff --git a/lib/core/logging.js b/lib/core/logging.js index e536eb01c..ba361657b 100644 --- a/lib/core/logging.js +++ b/lib/core/logging.js @@ -2,6 +2,7 @@ import { configureLog } from '@sitespeed.io/log'; export function configure(options = {}) { configureLog({ + level: options.logLevel ?? undefined, verbose: options.verbose ?? 0, silent: options.silent ?? false }); diff --git a/lib/plugins/browsertime/index.js b/lib/plugins/browsertime/index.js index 68d153c5d..7a361b773 100644 --- a/lib/plugins/browsertime/index.js +++ b/lib/plugins/browsertime/index.js @@ -3,6 +3,8 @@ import { parse } from 'node:url'; import { default as _merge } from 'lodash.merge'; import { getLogger } from '@sitespeed.io/log'; +import { configureLogging } from 'browsertime'; + const log = getLogger('plugin.browsertime'); import dayjs from 'dayjs'; @@ -88,10 +90,10 @@ export default class BrowsertimePlugin extends SitespeedioPlugin { 'browsertime.run' ); this.axeAggregatorTotal = new AxeAggregator(this.options); + configureLogging(options); } + async processMessage(message) { - const { configureLogging } = await import('browsertime'); - configureLogging(this.options); const options = this.options; switch (message.type) { // When sistespeed.io starts, a setup messages is posted on the queue diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a5b523e1c..609878554 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -17,7 +17,7 @@ "@slack/webhook": "7.0.4", "@tgwf/co2": "0.16.4", "axe-core": "4.10.2", - "browsertime": "24.2.0", + "browsertime": "24.3.0", "coach-core": "8.1.1", "dayjs": "1.11.11", "fast-crc32c": "2.0.0", @@ -3231,9 +3231,10 @@ } }, "node_modules/browsertime": { - "version": "24.2.0", - "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-24.2.0.tgz", - "integrity": "sha512-qC4sLm1tf18xdc5Hirpd6RRd4mz8T2dv+/7iImHG3U6BC8GoIio0picEBbtdB8dFXp0VgCBQwg1nFeSIf/HXBA==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/browsertime/-/browsertime-24.3.0.tgz", + "integrity": "sha512-wT4AuqwyHAwxn5L+rke8qtBHDOxg6KgdRPJFxsEYETZqLC3zv9xNDYWpMhfhS6sWkUMw7w/iRbx7wdzfZLvIeg==", + "license": "MIT", "dependencies": { "@devicefarmer/adbkit": "3.3.8", "@sitespeed.io/chromedriver": "133.0.6943-53", diff --git a/package.json b/package.json index 8d48628bc..6a31b3504 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@tgwf/co2": "0.16.4", "@slack/webhook": "7.0.4", "axe-core": "4.10.2", - "browsertime": "24.2.0", + "browsertime": "24.3.0", "coach-core": "8.1.1", "dayjs": "1.11.11", "fast-crc32c": "2.0.0",