Skip to content

Commit

Permalink
optimized logging
Browse files Browse the repository at this point in the history
Took 7 minutes
  • Loading branch information
erikyo committed Apr 8, 2024
1 parent b73c2bc commit 6b1b2af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/encodeImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export function encodeImage(
}
}

console.log(options.options);

// Save the image to the destination directory
if (options.options?.maxSize) {
image = image.resize({
Expand Down
4 changes: 2 additions & 2 deletions src/parseArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defaultConfigFile, extModes } from "./constants.js";
import yargs, { Argv } from "yargs";
import { CliOptions, ExtMode, ResizeType, resizeType } from "./types.js";
import { hideBin } from "yargs/helpers";
import { generateDefaultConfigFile } from "./utils.js";
import { generateDefaultConfigFile, logMessage } from "./utils.js";

/**
* Get the command-line settings
Expand Down Expand Up @@ -82,7 +82,7 @@ export function getCliOptions(rawArgs: Argv<object> | undefined): CliOptions {
if (Boolean(argv.defaultIni) && configFileName) {
generateDefaultConfigFile(configFileName, argv as Record<string, string>);

console.log(`Generated default config file: ${configFileName}`);
logMessage(`Generated default config file: ${configFileName}`, true);

process.exit(0);
}
Expand Down
3 changes: 2 additions & 1 deletion src/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ export async function getPromptOptions(

// If the compression settings are not specified, use the default compression settings
if (Object.keys(options.compressionOptions).length === 0) {
console.log(
logMessage(
"No compression settings found, so we will use the default compression settings",
true,
);
options.compressionOptions = defaultCompressionOptions();
}
Expand Down

0 comments on commit 6b1b2af

Please sign in to comment.