Merge "Move all status output to stdout"
am: b08468d2ab
Change-Id: Ie458b27d8e8146da0bcd5bcc9134205aad31e0a5
This commit is contained in:
@@ -45,7 +45,9 @@ func NewStatusOutput(w Writer, statusFormat string) status.StatusOutput {
|
||||
}
|
||||
|
||||
func (s *statusOutput) Message(level status.MsgLevel, message string) {
|
||||
if level > status.StatusLvl {
|
||||
if level >= status.ErrorLvl {
|
||||
s.writer.Print(fmt.Sprintf("FAILED: %s", message))
|
||||
} else if level > status.StatusLvl {
|
||||
s.writer.Print(fmt.Sprintf("%s%s", level.Prefix(), message))
|
||||
} else if level == status.StatusLvl {
|
||||
s.writer.StatusLine(message)
|
||||
|
@@ -81,8 +81,8 @@ func NewWriter(stdio StdioInterface) Writer {
|
||||
}
|
||||
|
||||
if term, ok := os.LookupEnv("TERM"); ok && term != "dumb" {
|
||||
w.stripEscapes = !isTerminal(stdio.Stderr())
|
||||
w.smartTerminal = isTerminal(stdio.Stdout()) && !w.stripEscapes
|
||||
w.smartTerminal = isTerminal(stdio.Stdout())
|
||||
w.stripEscapes = !w.smartTerminal
|
||||
}
|
||||
|
||||
return w
|
||||
@@ -127,9 +127,9 @@ func (w *writerImpl) print(str string) {
|
||||
fmt.Fprint(w.stdio.Stdout(), "\r", "\x1b[K")
|
||||
w.haveBlankLine = true
|
||||
}
|
||||
fmt.Fprint(w.stdio.Stderr(), str)
|
||||
fmt.Fprint(w.stdio.Stdout(), str)
|
||||
if len(str) == 0 || str[len(str)-1] != '\n' {
|
||||
fmt.Fprint(w.stdio.Stderr(), "\n")
|
||||
fmt.Fprint(w.stdio.Stdout(), "\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user