Skip to content

Commit

Permalink
Merge pull request #712 from loadimpact/logger-fixes
Browse files Browse the repository at this point in the history
Fix a bug with --no-color and wrap Go's std logger with logrus
  • Loading branch information
na-- authored Jul 16, 2018
2 parents c7b2516 + e56f969 commit 7796615
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package cmd
import (
"fmt"
"io"
golog "log"
"os"
"path/filepath"
"sync"
Expand Down Expand Up @@ -74,8 +75,9 @@ var RootCmd = &cobra.Command{
setupLoggers(logFmt)
if noColor {
stdout.Writer = colorable.NewNonColorable(os.Stdout)
stdout.Writer = colorable.NewNonColorable(os.Stderr)
stderr.Writer = colorable.NewNonColorable(os.Stderr)
}
golog.SetOutput(log.StandardLogger().Writer())
},
}

Expand Down
3 changes: 2 additions & 1 deletion release notes/upcoming.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Description of feature.

## Bugs fixed!

* Category: description of bug. (#PR)
* Logging: using the `--no-color` flag caused k6 to print output intended for `sdtout` to `stderr` instead. (#712)
* Logging: some error messages originating from Go's standard library did not obey the `--logformat` option. (#712)

0 comments on commit 7796615

Please sign in to comment.