Skip to content

Commit

Permalink
Add support to manually set the log level. (#2264)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Mar 3, 2025
1 parent 89d4312 commit 0922a49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/support/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,11 @@ export function parseCommandLine() {
describe:
'Append a String to the user agent. Works in Chrome/Edge and Firefox.'
})
.option('logLevel', {
type: 'string',
choices: ['trace', 'verbose', 'debug', 'info', 'warning', 'error'],
describe: 'Manually set the min log level'
})
.option('silent', {
alias: 'q',
type: 'count',
Expand Down
1 change: 1 addition & 0 deletions lib/support/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { configureLog } from '@sitespeed.io/log';
*/
export function configure(options = {}) {
configureLog({
level: options.logLevel ?? undefined,
verbose: options.verbose ?? 0,
silent: options.silent ?? false
});
Expand Down

0 comments on commit 0922a49

Please sign in to comment.