Add log_patterns to process config

log_patterns allow to filter the FFmpeg log messages based on regular
expressions. Each entry of log_patterns is interpreted as regular
expression and matched against every non-progress log line emitted from
FFmpeg. All matching lines are returned in the matches array of the
report.
This commit is contained in:
Ingo Oppermann
2023-03-27 15:50:25 +02:00
parent 814975dfee
commit 0a3117bbd0
12 changed files with 175 additions and 12 deletions

View File

@@ -55,6 +55,7 @@ type ProcessConfig struct {
StaleTimeout uint64 `json:"stale_timeout_seconds" format:"uint64"`
Timeout uint64 `json:"runtime_duration_seconds" format:"uint64"`
Scheduler string `json:"scheduler"`
LogPatterns []string `json:"log_patterns"`
Limits ProcessConfigLimits `json:"limits"`
}
@@ -107,6 +108,9 @@ func (cfg *ProcessConfig) Marshal() *app.Config {
}
p.LogPatterns = make([]string, len(cfg.LogPatterns))
copy(p.LogPatterns, cfg.LogPatterns)
return p
}
@@ -190,6 +194,9 @@ func (cfg *ProcessConfig) Unmarshal(c *app.Config) {
cfg.Output = append(cfg.Output, io)
}
cfg.LogPatterns = make([]string, len(c.LogPatterns))
copy(cfg.LogPatterns, c.LogPatterns)
}
// ProcessState represents the current state of an ffmpeg process