Move all output through StatusOutput
Write log output through StatusOutput so that the status implementation
can synchronize it with its own output.
Test: status_test.go
Change-Id: I917bdeeea4759a12b6b4aa6d6d86ee18a2771723
diff --git a/ui/terminal/smart_status.go b/ui/terminal/smart_status.go
index a52fdc2..9a4931c 100644
--- a/ui/terminal/smart_status.go
+++ b/ui/terminal/smart_status.go
@@ -104,6 +104,13 @@
s.requestLine()
}
+func (s *smartStatusOutput) Write(p []byte) (int, error) {
+ s.lock.Lock()
+ defer s.lock.Unlock()
+ s.print(string(p))
+ return len(p), nil
+}
+
func (s *smartStatusOutput) requestLine() {
if !s.haveBlankLine {
fmt.Fprintln(s.writer)