update log15 (#9622)

* Update log15 and go-isatty

* Update usage in pkg log
This commit is contained in:
stuart nelson
2017-10-23 19:57:19 +02:00
committed by Torkel Ödegaard
parent 9e697a1f6e
commit 93ac6680ab
16 changed files with 199 additions and 46 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/go-stack/stack"
"github.com/inconshreveable/log15"
"github.com/inconshreveable/log15/term"
isatty "github.com/mattn/go-isatty"
"github.com/grafana/grafana/pkg/util"
)
@@ -157,7 +157,7 @@ func getFilters(filterStrArray []string) map[string]log15.Lvl {
func getLogFormat(format string) log15.Format {
switch format {
case "console":
if term.IsTty(os.Stdout.Fd()) {
if isatty.IsTerminal(os.Stdout.Fd()) {
return log15.TerminalFormat()
}
return log15.LogfmtFormat()