From 56768640ac96358b3d3e6eba216007a3dbfff069 Mon Sep 17 00:00:00 2001 From: Supositware Date: Wed, 14 Sep 2022 11:32:01 +0200 Subject: [PATCH] Log stdout on NODE_ENV=development --- utils/videos.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/videos.js b/utils/videos.js index 14f9b6fe..d872013e 100644 --- a/utils/videos.js +++ b/utils/videos.js @@ -1,5 +1,6 @@ import os from 'node:os'; import { exec } from 'node:child_process'; +const { NODE_ENV } = process.env; export default { downloadVideo, @@ -17,6 +18,7 @@ async function downloadVideo(urlArg, output, format = 'bestvideo*+bestaudio/best if (stderr) { console.error(stderr); } + console.log(NODE_ENV === 'development' ? stdout : null); resolve(); }); }); @@ -45,6 +47,7 @@ async function ffmpeg(command) { if (stderr) { console.error(stderr); } + console.log(NODE_ENV === 'development' ? stdout : null); resolve(); }); }); @@ -69,6 +72,7 @@ async function compressVideo(input, output, preset) { if (stderr) { console.error(stderr); } + console.log(NODE_ENV === 'development' ? stdout : null); resolve(); }); });