diff options
author | 2022-05-06 16:04:44 -0700 | |
---|---|---|
committer | 2022-07-19 08:02:42 -0700 | |
commit | 2cec8df3a854e91424c3457ec7af12a8bc7e2bbe (patch) | |
tree | d13e5c6efc0e313b9bcadaabb1132f9bce27bf80 | |
parent | 7c81cf6e4e71034b4a855eb8356270c717403b0b (diff) |
Revert "Suppress all progress messages from Ninja if ANDROID_QUIET_BUILD is set."
Reverts commit 827aead340c7e89257da6ff08bde39629de84689
The change being reverted is the result of misunderstanding of how the
status system works. It has to be reverted because it would suppress
_all_ error messages from Make. Achieving what this change purports is
is more involved and requires changing the code to separate progress message
stream from application output stream.
Test: run failing build with ANDROID_QUIET_BUILD=tree and observe errors being output
Change-Id: If9148a7fa773ae32fb0870a448e9470560e53900
-rw-r--r-- | ui/terminal/simple_status.go | 27 | ||||
-rw-r--r-- | ui/terminal/status.go | 6 |
2 files changed, 12 insertions, 21 deletions
diff --git a/ui/terminal/simple_status.go b/ui/terminal/simple_status.go index cef3b5d5c..9e9ffc003 100644 --- a/ui/terminal/simple_status.go +++ b/ui/terminal/simple_status.go @@ -22,30 +22,24 @@ import ( ) type simpleStatusOutput struct { - writer io.Writer - formatter formatter - keepANSI bool - outputLevel status.MsgLevel + writer io.Writer + formatter formatter + keepANSI bool } // NewSimpleStatusOutput returns a StatusOutput that represents the // current build status similarly to Ninja's built-in terminal // output. -func NewSimpleStatusOutput(w io.Writer, formatter formatter, keepANSI bool, quietBuild bool) status.StatusOutput { - level := status.StatusLvl - if quietBuild { - level = status.PrintLvl - } +func NewSimpleStatusOutput(w io.Writer, formatter formatter, keepANSI bool) status.StatusOutput { return &simpleStatusOutput{ - writer: w, - formatter: formatter, - keepANSI: keepANSI, - outputLevel: level, + writer: w, + formatter: formatter, + keepANSI: keepANSI, } } func (s *simpleStatusOutput) Message(level status.MsgLevel, message string) { - if level >= s.outputLevel { + if level >= status.StatusLvl { output := s.formatter.message(level, message) if !s.keepANSI { output = string(stripAnsiEscapes([]byte(output))) @@ -54,13 +48,10 @@ func (s *simpleStatusOutput) Message(level status.MsgLevel, message string) { } } -func (s *simpleStatusOutput) StartAction(_ *status.Action, _ status.Counts) { +func (s *simpleStatusOutput) StartAction(action *status.Action, counts status.Counts) { } func (s *simpleStatusOutput) FinishAction(result status.ActionResult, counts status.Counts) { - if s.outputLevel > status.StatusLvl { - return - } str := result.Description if str == "" { str = result.Command diff --git a/ui/terminal/status.go b/ui/terminal/status.go index ff0af4737..2ad174fee 100644 --- a/ui/terminal/status.go +++ b/ui/terminal/status.go @@ -29,9 +29,9 @@ import ( func NewStatusOutput(w io.Writer, statusFormat string, forceSimpleOutput, quietBuild, forceKeepANSI bool) status.StatusOutput { formatter := newFormatter(statusFormat, quietBuild) - if forceSimpleOutput || quietBuild || !isSmartTerminal(w) { - return NewSimpleStatusOutput(w, formatter, forceKeepANSI, quietBuild) - } else { + if !forceSimpleOutput && isSmartTerminal(w) { return NewSmartStatusOutput(w, formatter) + } else { + return NewSimpleStatusOutput(w, formatter, forceKeepANSI) } } |