replace unkeyed fiels with keyed fields when instantiating log struct

This commit is contained in:
bartfokker 2018-10-25 22:17:05 +02:00
parent db3d7e8927
commit 4d247f5272
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ func (l *DockerLogs) Stream() chan models.Log {
for scanner.Scan() {
parts := strings.Split(scanner.Text(), " ")
ts := l.parseTime(parts[0])
logCh <- models.Log{ts, strings.Join(parts[1:], " ")}
logCh <- models.Log{Timestamp: ts, Message: strings.Join(parts[1:], " ")}
}
}()

View File

@ -20,7 +20,7 @@ func (l *MockLogs) Stream() chan models.Log {
case <-l.done:
break
default:
logCh <- models.Log{time.Now(), mockLog}
logCh <- models.Log{Timestamp: time.Now(), Message: mockLog}
time.Sleep(250 * time.Millisecond)
}
}