Skip to content

Commit

Permalink
Merge pull request #296 from microsoft/danmihai1/empty-log-lines
Browse files Browse the repository at this point in the history
runtime: skip empty Guest console output lines
  • Loading branch information
danmihai1 authored and sprt committed Feb 10, 2025
2 parents a1acdb0 + 36d5738 commit eea3c10
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/runtime/virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -1267,12 +1267,15 @@ func (cw *consoleWatcher) start(s *Sandbox) (err error) {

go func() {
for scanner.Scan() {
s.Logger().WithFields(logrus.Fields{
"console-protocol": cw.proto,
"console-url": cw.consoleURL,
"sandbox": s.id,
"vmconsole": scanner.Text(),
}).Debug("reading guest console")
text := scanner.Text()
if text != "" {
s.Logger().WithFields(logrus.Fields{
"console-protocol": cw.proto,
"console-url": cw.consoleURL,
"sandbox": s.id,
"vmconsole": text,
}).Debug("reading guest console")
}
}

if err := scanner.Err(); err != nil {
Expand Down

0 comments on commit eea3c10

Please sign in to comment.