mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
replace unkeyed fiels with keyed fields when instantiating log struct
This commit is contained in:
parent
db3d7e8927
commit
4d247f5272
@ -48,7 +48,7 @@ func (l *DockerLogs) Stream() chan models.Log {
|
|||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
parts := strings.Split(scanner.Text(), " ")
|
parts := strings.Split(scanner.Text(), " ")
|
||||||
ts := l.parseTime(parts[0])
|
ts := l.parseTime(parts[0])
|
||||||
logCh <- models.Log{ts, strings.Join(parts[1:], " ")}
|
logCh <- models.Log{Timestamp: ts, Message: strings.Join(parts[1:], " ")}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ func (l *MockLogs) Stream() chan models.Log {
|
|||||||
case <-l.done:
|
case <-l.done:
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
logCh <- models.Log{time.Now(), mockLog}
|
logCh <- models.Log{Timestamp: time.Now(), Message: mockLog}
|
||||||
time.Sleep(250 * time.Millisecond)
|
time.Sleep(250 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user