Skip to content

🎥 Make videos programmatically with React

fix lambda logs

Jonny Burgerb2d18c50e68f
diff --git a/packages/lambda/src/cli/commands/functions/deploy.ts b/packages/lambda/src/cli/commands/functions/deploy.ts
index 93d1c655c8..1f4ec97542 100644
--- a/packages/lambda/src/cli/commands/functions/deploy.ts
+++ b/packages/lambda/src/cli/commands/functions/deploy.ts
@@ -53,8 +53,9 @@ CloudWatch Retention Period = ${cloudWatchLogRetentionPeriodInDays} days
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({
logLevel: RenderInternals.getLogLevel(),
}),
+ indent: false,
});
- output.update('Deploying Lambda...');
+ output.update('Deploying Lambda...', false);
const {functionName, alreadyExisted} = await deployFunction({
createCloudWatchLogGroup,
region,
@@ -69,8 +70,8 @@ CloudWatch Retention Period = ${cloudWatchLogRetentionPeriodInDays} days
}
if (alreadyExisted) {
- output.update(`Already exists as ${functionName}\n`);
+ output.update(`Already exists as ${functionName}`, true);
} else {
- output.update(`Deployed as ${functionName}\n`);
+ output.update(`Deployed as ${functionName}\n`, true);
}
};
diff --git a/packages/lambda/src/cli/commands/functions/ls.ts b/packages/lambda/src/cli/commands/functions/ls.ts
index fb26041a79..ffcfcfd9fc 100644
--- a/packages/lambda/src/cli/commands/functions/ls.ts
+++ b/packages/lambda/src/cli/commands/functions/ls.ts
@@ -19,8 +19,9 @@ export const functionsLsCommand = async () => {
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({
logLevel: RenderInternals.getLogLevel(),
}),
+ indent: false,
});
- fetchingOutput.update('Getting functions...');
+ fetchingOutput.update('Getting functions...', false);
const functions = await getFunctions({
region,
@@ -37,11 +38,12 @@ export const functionsLsCommand = async () => {
return;
}
- fetchingOutput.update('Getting function info...');
+ fetchingOutput.update('Getting function info...', false);
const pluralized = functions.length === 1 ? 'function' : 'functions';
fetchingOutput.update(
- `${functions.length} ${pluralized} in the ${region} region`
+ `${functions.length} ${pluralized} in the ${region} region`,
+ true
);
CliInternals.Log.info();
CliInternals.Log.info(
diff --git a/packages/lambda/src/cli/commands/functions/rm.ts b/packages/lambda/src/cli/commands/functions/rm.ts
index 63fa95cdc4..322e3e8f2c 100644
--- a/packages/lambda/src/cli/commands/functions/rm.ts
+++ b/packages/lambda/src/cli/commands/functions/rm.ts
@@ -39,8 +39,9 @@ export const functionsRmCommand = async (args: string[]) => {
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({
logLevel: RenderInternals.getLogLevel(),
}),
+ indent: false,
});
- infoOutput.update('Getting function info...');
+ infoOutput.update('Getting function info...', false);
const info = await getFunctionInfo({
region,
functionName,
@@ -52,9 +53,9 @@ export const functionsRmCommand = async (args: string[]) => {
'Memory: '.padEnd(LEFT_COL, ' ') + ' ' + info.memorySizeInMb + 'MB',
'Timeout: '.padEnd(LEFT_COL, ' ') + ' ' + info.timeoutInSeconds + 'sec',
'Version: '.padEnd(LEFT_COL, ' ') + ' ' + info.version,
- ].join('\n')
+ ].join('\n'),
+ true
);
- Log.info();
await confirmCli({delMessage: 'Delete? (Y/n)', allowForceFlag: true});
const output = CliInternals.createOverwriteableCliOutput({
@@ -63,9 +64,10 @@ export const functionsRmCommand = async (args: string[]) => {
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({
logLevel: RenderInternals.getLogLevel(),
}),
+ indent: false,
});
- output.update('Deleting...');
+ output.update('Deleting...', false);
await deleteFunction({region, functionName});
- output.update('Deleted!\n');
+ output.update('Deleted!', true);
}
};
diff --git a/packages/lambda/src/cli/commands/functions/rmall.ts b/packages/lambda/src/cli/commands/functions/rmall.ts
index 8413d4c7b7..1005761ec8 100644
--- a/packages/lambda/src/cli/commands/functions/rmall.ts
+++ b/packages/lambda/src/cli/commands/functions/rmall.ts
@@ -5,7 +5,6 @@ import {getFunctionInfo} from '../../../api/get-function-info';
import {getFunctions} from '../../../api/get-functions';
import {getAwsRegion} from '../../get-aws-region';
import {confirmCli} from '../../helpers/confirm';
-import {Log} from '../../log';
export const FUNCTIONS_RMALL_SUBCOMMAND = 'rmall';
const LEFT_COL = 16;
@@ -24,8 +23,9 @@ export const functionsRmallCommand = async () => {
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({
logLevel: RenderInternals.getLogLevel(),
}),
+ indent: false,
});
- infoOutput.update('Getting function info...');
+ infoOutput.update('Getting function info...', false);
const info = await getFunctionInfo({
region,
functionName: fun.functionName,
@@ -37,9 +37,9 @@ export const functionsRmallCommand = async () => {
'Memory: '.padEnd(LEFT_COL, ' ') + ' ' + info.memorySizeInMb + 'MB',
'Timeout: '.padEnd(LEFT_COL, ' ') + ' ' + info.timeoutInSeconds + 'sec',
'Version: '.padEnd(LEFT_COL, ' ') + ' ' + info.version,
- ].join('\n')
+ ].join('\n'),
+ true
);
- Log.info();
await confirmCli({delMessage: 'Delete? (Y/n)', allowForceFlag: true});
const output = CliInternals.createOverwriteableCliOutput({
@@ -48,9 +48,10 @@ export const functionsRmallCommand = async () => {
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({
logLevel: RenderInternals.getLogLevel(),
}),
+ indent: false,
});
- output.update('Deleting...');
+ output.update('Deleting...', false);
await deleteFunction({region, functionName: fun.functionName});
- output.update('Deleted!\n');
+ output.update('Deleted!', true);
}
};
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index b265470e05..e01053dab9 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -152,6 +152,7 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
quiet: CliInternals.quietFlagProvided(),
cancelSignal: null,
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({logLevel}),
+ indent: false,
});
Log.info(
@@ -187,7 +188,8 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
verbose,
totalFrames: getTotalFrames(status),
timeToEncode: status.timeToEncode,
- })
+ }),
+ false
);
// eslint-disable-next-line no-constant-condition
@@ -209,7 +211,8 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
verbose,
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
- })
+ }),
+ false
);
if (newStatus.done) {
@@ -222,7 +225,8 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
verbose,
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
- })
+ }),
+ false
);
if (downloadName) {
const downloadStart = Date.now();
@@ -245,7 +249,8 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
verbose,
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
- })
+ }),
+ false
);
},
});
@@ -262,7 +267,8 @@ export const renderCommand = async (args: string[], remotionRoot: string) => {
verbose,
timeToEncode: newStatus.timeToEncode,
totalFrames: getTotalFrames(newStatus),
- })
+ }),
+ false
);
Log.info();
Log.info();
diff --git a/packages/lambda/src/cli/commands/sites/create.ts b/packages/lambda/src/cli/commands/sites/create.ts
index 83816a20de..8ab18b2efb 100644
--- a/packages/lambda/src/cli/commands/sites/create.ts
+++ b/packages/lambda/src/cli/commands/sites/create.ts
@@ -53,6 +53,7 @@ export const sitesCreateSubcommand = async (
updatesDontOverwrite: CliInternals.shouldUseNonOverlayingLogger({
logLevel: RenderInternals.getLogLevel(),
}),
+ indent: false,
});
const multiProgress: {
@@ -81,7 +82,8 @@ export const sitesCreateSubcommand = async (
makeBundleProgress(multiProgress.bundleProgress),
makeBucketProgress(multiProgress.bucketProgress),
makeDeployProgressBar(multiProgress.deployProgress),
- ].join('\n')
+ ].join('\n'),
+ false
);
};