Skip to content

Commit 91d50ec

Browse files
committed
feat: clean up logging and reporting
1 parent 73f67b3 commit 91d50ec

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/gatsby-transformer-video/src/ffmpeg.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export default class FFMPEG {
8989
reject(err)
9090
})
9191
.on(`end`, () => {
92-
reporter.verbose(`${name} - 100%`)
9392
reporter.info(`${name} - converted`)
9493
resolve()
9594
})
@@ -119,9 +118,7 @@ export default class FFMPEG {
119118
}
120119

121120
if (!path) {
122-
throw new Error(
123-
`Unable to extract asset file path for ${type} (${video.id})`
124-
)
121+
throw new Error(`Unable to locate video file for ${type} (${video.id})`)
125122
}
126123

127124
const optionsHash = createContentDigest(fieldArgs)

packages/gatsby-transformer-video/src/helpers.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export async function cacheContentfulVideo({ video, cacheDir }) {
2727

2828
try {
2929
await access(path, fs.constants.R_OK)
30-
reporter.verbose(`Already downloaded ${url}`)
30+
reporter.verbose(`Cache hit: ${url}`)
3131
downloadCache[url] = path
3232

3333
return downloadCache[url]
3434
} catch {
3535
if (url in downloadCache) {
36-
// Already downloading
36+
// Already in download queue
3737
return downloadCache[url]
3838
}
3939

@@ -44,7 +44,7 @@ export async function cacheContentfulVideo({ video, cacheDir }) {
4444
while (!downloaded) {
4545
try {
4646
await downloadQueue.add(async () => {
47-
reporter.info(`Downloading ${url}`)
47+
reporter.info(`Downloading: ${url}`)
4848

4949
const response = await axios({
5050
method: `get`,

0 commit comments

Comments
 (0)