🎥 Make videos programmatically with React
respect log level everywher
Jonny Burger798bc2a21075
diff --git a/packages/cli/src/get-filename.ts b/packages/cli/src/get-filename.tsindex 9f9df0a02c..687dae3371 100644--- a/packages/cli/src/get-filename.ts+++ b/packages/cli/src/get-filename.ts@@ -35,25 +35,25 @@ export const getOutputFilename = ({if (extension === null && !imageSequence) {if (codec === 'h264' || codec === 'h265') {- Log.info('No file extension specified, adding .mp4 automatically.');+ Log.warn('No file extension specified, adding .mp4 automatically.');filename += '.mp4';extension = 'mp4';}if (codec === 'h264-mkv') {- Log.info('No file extension specified, adding .mkv automatically.');+ Log.warn('No file extension specified, adding .mkv automatically.');filename += '.mkv';extension = 'mkv';}if (codec === 'vp8' || codec === 'vp9') {- Log.info('No file extension specified, adding .webm automatically.');+ Log.warn('No file extension specified, adding .webm automatically.');filename += '.webm';extension = 'webm';}if (codec === 'prores') {- Log.info('No file extension specified, adding .mov automatically.');+ Log.warn('No file extension specified, adding .mov automatically.');filename += '.mov';extension = 'mov';}diff --git a/packages/cli/src/progress-bar.ts b/packages/cli/src/progress-bar.tsindex 232c536998..7c92ad07f3 100644--- a/packages/cli/src/progress-bar.ts+++ b/packages/cli/src/progress-bar.ts@@ -1,8 +1,15 @@// @ts-expect-errorimport ansiDiff from 'ansi-diff';import chalk from 'chalk';+import {Internals} from 'remotion';++export const createProgressBar = (): {+ update: (str: string) => boolean;+} => {+ if (!Internals.Logging.isEqualOrBelowLogLevel('info')) {+ return {update: () => false};+ }-export const createProgressBar = () => {const diff = ansiDiff();process.stdout.write('');return {diff --git a/packages/cli/src/setup-cache.ts b/packages/cli/src/setup-cache.tsindex 31625c8019..2d232751b8 100644--- a/packages/cli/src/setup-cache.ts+++ b/packages/cli/src/setup-cache.ts@@ -7,9 +7,8 @@ export const bundleOnCli = async (fullPath: string, steps: number) => {const shouldCache = Internals.getWebpackCaching();const cacheExistedBefore = BundlerInternals.cacheExists('production', null);if (cacheExistedBefore && !shouldCache) {- process.stdout.write('🧹 Cache disabled but found. Deleting... ');+ Log.info('🧹 Cache disabled but found. Deleting... ');await BundlerInternals.clearCache('production', null);- process.stdout.write('done. \n');}const bundleStartTime = Date.now();diff --git a/packages/cli/src/upgrade.ts b/packages/cli/src/upgrade.tsindex c9b7c86d1e..0263e94cf8 100644--- a/packages/cli/src/upgrade.ts+++ b/packages/cli/src/upgrade.ts@@ -1,6 +1,7 @@import execa from 'execa';import fs from 'fs';import path from 'path';+import {Internals} from 'remotion';import {Log} from './log';const npmOrYarn = (): 'npm' | 'yarn' => {@@ -64,7 +65,10 @@ export const upgrade = async () => {].filter((u) => dependencies.includes(u));const prom = execa(tool, ['upgrade', ...toUpgrade]);- prom.stdout?.pipe(process.stdout);+ if (Internals.Logging.isEqualOrBelowLogLevel('info')) {+ prom.stdout?.pipe(process.stdout);+ }+await prom;Log.info('⏫ Remotion has been upgraded!');};diff --git a/packages/docs/docs/cli.md b/packages/docs/docs/cli.mdindex 17ea96a17f..cd59c0f65d 100644--- a/packages/docs/docs/cli.md+++ b/packages/docs/docs/cli.md@@ -150,7 +150,7 @@ _available for `still`, `render` commands__available for `preview`, `still`, `render` commands_-[Set the log level](/docs/config#setlevel). Increase or decrease the amount of output. Acceptable values: `error`, `warning`, `info` (_default_), `verbose`+[Set the log level](/docs/config#setlevel). Increase or decrease the amount of output. Acceptable values: `error`, `warn`, `info` (_default_), `verbose`:::infoIf you don't feel like passing command line flags every time, consider creating a `remotion.config.ts` [config file](/docs/config).diff --git a/packages/docs/docs/config.mdx b/packages/docs/docs/config.mdxindex b15499be15..4c903cf6ed 100644--- a/packages/docs/docs/config.mdx+++ b/packages/docs/docs/config.mdx@@ -75,7 +75,7 @@ Increase or decrease the amount of log messages in the CLI.Acceptable values:- `error`: Silent except error messages.-- `warning`: Only showing errors and warnings.+- `warn`: Only showing errors and warnings.- `info` (_default_): Default output - besides errors and warnings, prints progress and output location.- `verbose`: All of the above, plus browser logs and other debug info.