mirror of https://github.com/0xERR0R/blocky.git
fix: ANSI color codes being printed on Windows (#1225)
* added go-colorable * fixed bug which prevented windows builds
This commit is contained in:
parent
23ce44d457
commit
d87e6b4157
2
go.mod
2
go.mod
|
@ -15,7 +15,7 @@ require (
|
|||
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/hashicorp/golang-lru v1.0.2
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/miekg/dns v1.1.56
|
||||
github.com/mroth/weightedrand/v2 v2.1.0
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/mattn/go-colorable"
|
||||
"github.com/sirupsen/logrus"
|
||||
prefixed "github.com/x-cray/logrus-prefixed-formatter"
|
||||
"golang.org/x/exp/maps"
|
||||
|
@ -111,6 +112,9 @@ func ConfigureLogger(cfg *Config) {
|
|||
|
||||
logger.SetFormatter(logFormatter)
|
||||
|
||||
// Windows does not support ANSI colors
|
||||
logger.SetOutput(colorable.NewColorableStdout())
|
||||
|
||||
case FormatTypeJson:
|
||||
logger.SetFormatter(&logrus.JSONFormatter{})
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
package server
|
||||
|
||||
func registerPrintConfigurationTrigger(s *Server) {
|
||||
import "context"
|
||||
|
||||
func registerPrintConfigurationTrigger(ctx context.Context, s *Server) {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue