Skip to content

Commit 18341ec

Browse files
fix: configure logger for silent of verbose modes
1 parent d78e86a commit 18341ec

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Command } from "commander";
33
import fs from "fs";
44
import chalk from "chalk";
5-
import { logger, OUTPUT_LEVELS } from "./lib/logger.js";
5+
import { logger, OUTPUT_LEVELS, configureLogger } from "./lib/logger.js";
66
import {
77
validateInputs,
88
getUrlList,
@@ -38,6 +38,7 @@ program
3838
.parse(process.argv);
3939

4040
const options = program.opts();
41+
configureLogger(options);
4142

4243
// Validate mutually exclusive flags
4344
if (options.verbose && options.silent) {

src/lib/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const OUTPUT_LEVELS = {
66
VERBOSE: 2,
77
};
88

9-
export const outputLevel = OUTPUT_LEVELS.NORMAL;
9+
export let outputLevel = OUTPUT_LEVELS.NORMAL;
1010

1111
export function configureLogger(options) {
1212
outputLevel = options.silent

0 commit comments

Comments
 (0)