docker_logs.go use SplitN(2)

This commit is contained in:
Sergey Ponomarev 2020-11-26 12:08:36 +02:00
parent 6c662d91fb
commit 948e7cc9d0

View File

@ -47,9 +47,9 @@ func (l *DockerLogs) Stream() chan models.Log {
go func() {
scanner := bufio.NewScanner(r)
for scanner.Scan() {
parts := strings.Split(scanner.Text(), " ")
parts := strings.SplitN(scanner.Text(), " ", 2)
ts := l.parseTime(parts[0])
logCh <- models.Log{Timestamp: ts, Message: strings.Join(parts[1:], " ")}
logCh <- models.Log{Timestamp: ts, Message: parts[1]}
}
}()