Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ func (w *StandardWriter) WriteErr(errMessage *Error) error {
w.outputMutex.Lock()
defer w.outputMutex.Unlock()

// Write to stdout when JSON output is enabled
if w.json {
gologger.Silent().Msgf("%s", string(data))
if w.outputFile != nil {
if err := w.outputFile.Write(data); err != nil {
return errkit.Wrap(err, "output: write error to output file")
}
}
}

if w.errorFile != nil {
if err := w.errorFile.Write(data); err != nil {
return errkit.Wrap(err, "output: write to error file")
Expand Down
Loading