feat(ffmpeg): logging callback handler

This commit is contained in:
Adrian Shum 2022-09-11 11:21:48 +08:00
parent 57541418b9
commit 2b72572127

View file

@ -33,13 +33,11 @@ func (p *Processor) Startup(_ context.Context) error {
message = strings.TrimSuffix(message, "\n")
switch level {
case ffmpeg.AVLogTrace, ffmpeg.AVLogDebug, ffmpeg.AVLogVerbose:
p.Logger.Debug("ffmpeg", zap.String("msg", message))
p.Logger.Debug("ffmpeg", zap.String("log", message))
case ffmpeg.AVLogInfo:
p.Logger.Info("ffmpeg", zap.String("msg", message))
case ffmpeg.AVLogWarning:
p.Logger.Warn("ffmpeg", zap.String("msg", message))
case ffmpeg.AVLogError, ffmpeg.AVLogFatal, ffmpeg.AVLogPanic:
p.Logger.Error("ffmpeg", zap.String("msg", message))
p.Logger.Info("ffmpeg", zap.String("log", message))
case ffmpeg.AVLogWarning, ffmpeg.AVLogError, ffmpeg.AVLogFatal, ffmpeg.AVLogPanic:
p.Logger.Warn("ffmpeg", zap.String("log", message))
}
})
if p.Debug {