Fix runner ffmpeg logger

pull/6318/head
Chocobozzz 2024-04-03 09:17:45 +02:00
parent 1b323f4f65
commit 0794fe2ac1
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 13 additions and 4 deletions

View File

@ -1,10 +1,19 @@
import { LogFn } from 'pino'
import { logger } from '../../../shared/index.js' import { logger } from '../../../shared/index.js'
export function getTranscodingLogger () { export function getTranscodingLogger () {
return { return {
info: logger.info.bind(logger), info: buildWinstonLogger(logger.info.bind(logger)),
debug: logger.debug.bind(logger), debug: buildWinstonLogger(logger.debug.bind(logger)),
warn: logger.warn.bind(logger), warn: buildWinstonLogger(logger.warn.bind(logger)),
error: logger.error.bind(logger) error: buildWinstonLogger(logger.error.bind(logger))
}
}
function buildWinstonLogger (log: LogFn) {
return (arg1: string, arg2?: object) => {
if (arg2) return log(arg2, arg1)
return log(arg1)
} }
} }