mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 08:27:08 +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:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
type FFmpeg interface {
|
||||
New(config ProcessConfig) (process.Process, error)
|
||||
NewProcessParser(logger log.Logger, id, reference string) parse.Parser
|
||||
NewProcessParser(logger log.Logger, id, reference string, logpatterns []string) parse.Parser
|
||||
NewProbeParser(logger log.Logger) probe.Parser
|
||||
ValidateInputAddress(address string) bool
|
||||
ValidateOutputAddress(address string) bool
|
||||
@@ -168,11 +168,12 @@ func (f *ffmpeg) New(config ProcessConfig) (process.Process, error) {
|
||||
return ffmpeg, err
|
||||
}
|
||||
|
||||
func (f *ffmpeg) NewProcessParser(logger log.Logger, id, reference string) parse.Parser {
|
||||
func (f *ffmpeg) NewProcessParser(logger log.Logger, id, reference string, logpatterns []string) parse.Parser {
|
||||
p := parse.New(parse.Config{
|
||||
LogLines: f.logLines,
|
||||
LogHistory: f.historyLength,
|
||||
LogMinimalHistory: f.minimalHistoryLength,
|
||||
Patterns: logpatterns,
|
||||
Logger: logger,
|
||||
Collector: NewWrappedCollector(id, reference, f.collector),
|
||||
})
|
||||
|
Reference in New Issue
Block a user