mirror of
https://github.com/datarhei/core.git
synced 2025-11-03 02:23:42 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user