diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 185e4ba1..ca69617e 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -965,18 +965,15 @@ func (p *ptpProcess) cmdRun(stdoutToSocket bool, pm *plugin.PluginManager) { for scanner.Scan() { output := scanner.Text() - - if regexErr != nil || !logFilterRegex.MatchString(output) { - fmt.Printf("%s\n", output) - } if p.name == chronydProcessName { output = fmt.Sprintf("%s[%d]%s: %s", chronydProcessName, p.cmd.Process.Pid, p.messageTag, output) } output = pm.ProcessLog(p.name, output) - fmt.Printf("%s\n", output) // for ts2phc from 4.2 onwards replace /dev/ptpX by actual interface name output = fmt.Sprintf("%s\n", p.replaceClockID(output)) - // for ts2phc, we need to extract metrics to identify GM state + if regexErr != nil || !logFilterRegex.MatchString(output) { + fmt.Printf("%s\n", output) + } p.processPTPMetrics(output) if p.name == ptp4lProcessName { if strings.Contains(output, ClockClassChangeIndicator) {