add _MINIO_SERVER_DEBUG env for enabling debug messages (#11128)

This commit is contained in:
Harshavardhana
2020-12-17 16:52:47 -08:00
committed by GitHub
parent 7c9ef76f66
commit f714840da7
9 changed files with 30 additions and 20 deletions

View File

@@ -30,6 +30,7 @@ import (
"strings"
"time"
"github.com/fatih/color"
dns2 "github.com/miekg/dns"
"github.com/minio/cli"
"github.com/minio/minio-go/v7/pkg/set"
@@ -38,9 +39,13 @@ import (
"github.com/minio/minio/cmd/logger"
"github.com/minio/minio/pkg/auth"
"github.com/minio/minio/pkg/certs"
"github.com/minio/minio/pkg/console"
"github.com/minio/minio/pkg/env"
)
// serverDebugLog will enable debug printing
var serverDebugLog = env.Get("_MINIO_SERVER_DEBUG", config.EnableOff) == config.EnableOn
func init() {
logger.Init(GOPATH, GOROOT)
logger.RegisterError(config.FmtError)
@@ -53,6 +58,8 @@ func init() {
globalReplicationState = newReplicationState()
globalTransitionState = newTransitionState()
console.SetColor("Debug", color.New())
gob.Register(StorageErr(""))
}