mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
docker_logs.go use SplitN(2)
This commit is contained in:
@@ -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]}
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user