Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting rid of external logging #11085

Merged
merged 4 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion go/cmd/vtcombo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ import (
"strings"
"time"

"vitess.io/vitess/go/vt/log"

"github.com/spf13/pflag"
"google.golang.org/protobuf/proto"

"vitess.io/vitess/go/exit"
"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/vt/dbconfigs"
"vitess.io/vitess/go/vt/env"
"vitess.io/vitess/go/vt/log"

"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/mysqlctl"
"vitess.io/vitess/go/vt/servenv"
Expand Down
31 changes: 2 additions & 29 deletions go/cmd/vtorc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ import (
_ "github.com/mattn/go-sqlite3"
"github.com/spf13/pflag"

_flag "vitess.io/vitess/go/internal/flag"
"vitess.io/vitess/go/vt/log"
vtlog "vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
"vitess.io/vitess/go/vt/orchestrator/app"
"vitess.io/vitess/go/vt/orchestrator/config"
"vitess.io/vitess/go/vt/orchestrator/external/golib/log"
"vitess.io/vitess/go/vt/orchestrator/inst"
"vitess.io/vitess/go/vt/servenv"

_flag "vitess.io/vitess/go/internal/flag"
)

var (
Expand Down Expand Up @@ -127,10 +126,6 @@ func main() {
sibling := fs.StringP("sibling", "s", "", "sibling instance, host_fqdn[:port]")
destination := fs.StringP("destination", "d", "", "destination instance, host_fqdn[:port] (synonym to -s)")
discovery := fs.Bool("discovery", true, "auto discovery mode")
quiet := fs.Bool("quiet", false, "quiet")
verbose := fs.Bool("verbose", false, "verbose")
debug := fs.Bool("debug", false, "debug mode (very verbose)")
stack := fs.Bool("stack", false, "add stack trace upon error")
config.RuntimeCLIFlags.SkipUnresolve = fs.Bool("skip-unresolve", false, "Do not unresolve a host name")
config.RuntimeCLIFlags.SkipUnresolveCheck = fs.Bool("skip-unresolve-check", false, "Skip/ignore checking an unresolve mapping (via hostname_unresolve table) resolves back to same hostname")
config.RuntimeCLIFlags.Noop = fs.Bool("noop", false, "Dry run; do not perform destructing operations")
Expand Down Expand Up @@ -178,17 +173,6 @@ Please update your scripts before the next version, when this will begin to brea
*destination = *sibling
}

log.SetLevel(log.ERROR)
if *verbose {
log.SetLevel(log.INFO)
}
if *debug {
log.SetLevel(log.DEBUG)
}
if *stack {
log.SetPrintStackTrace(*stack)
}

startText := "starting orchestrator"
if AppVersion != "" {
startText += ", version: " + AppVersion
Expand All @@ -206,17 +190,6 @@ Please update your scripts before the next version, when this will begin to brea
if *config.RuntimeCLIFlags.EnableDatabaseUpdate {
config.Config.SkipOrchestratorDatabaseUpdate = false
}
if config.Config.Debug {
log.SetLevel(log.DEBUG)
}
if *quiet {
// Override!!
log.SetLevel(log.ERROR)
}
if config.Config.EnableSyslog {
log.EnableSyslogWriter("orchestrator")
log.SetSyslogLevel(log.INFO)
}
if config.Config.AuditToSyslog {
inst.EnableAuditSyslog()
}
Expand Down
Loading