Skip to content

Commit

Permalink
Getting rid of external logging (vitessio#11085)
Browse files Browse the repository at this point in the history
* Getting rid of external logging

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fix unit test failures

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fix static code check

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fixing linter error

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
  • Loading branch information
rsajwani authored and timvaillancourt committed Aug 16, 2023
1 parent d0f4614 commit 9beab39
Show file tree
Hide file tree
Showing 61 changed files with 1,076 additions and 2,034 deletions.
8 changes: 3 additions & 5 deletions go/cmd/vtcombo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ import (
"strings"
"time"

"vitess.io/vitess/go/vt/env"
"vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext"

"vitess.io/vitess/go/vt/vttest"

"google.golang.org/protobuf/proto"

"vitess.io/vitess/go/exit"
"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"
Expand All @@ -48,7 +44,9 @@ import (
"vitess.io/vitess/go/vt/vtcombo"
"vitess.io/vitess/go/vt/vtctld"
"vitess.io/vitess/go/vt/vtgate"
"vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext"
"vitess.io/vitess/go/vt/vttablet/tabletserver/tabletenv"
"vitess.io/vitess/go/vt/vttest"
"vitess.io/vitess/go/vt/wrangler"

topodatapb "vitess.io/vitess/go/vt/proto/topodata"
Expand Down
34 changes: 3 additions & 31 deletions go/cmd/vtorc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ import (
"strings"

_ "github.com/go-sql-driver/mysql"
_ "modernc.org/sqlite"

"github.com/spf13/pflag"
_ "modernc.org/sqlite"

_flag "vitess.io/vitess/go/internal/flag"
"vitess.io/vitess/go/vt/log"
"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 @@ -124,10 +122,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 @@ -175,17 +169,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 @@ -203,17 +186,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

0 comments on commit 9beab39

Please sign in to comment.