Skip to content

Commit

Permalink
This is an automated cherry-pick of tikv#8118
Browse files Browse the repository at this point in the history
close tikv#8117

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
rleungx authored and ti-chi-bot committed May 8, 2024
1 parent 286add2 commit db7175c
Show file tree
Hide file tree
Showing 7 changed files with 881 additions and 13 deletions.
32 changes: 31 additions & 1 deletion cmd/pd-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,31 @@ func NewTSOServiceCommand() *cobra.Command {
cmd.Flags().StringP("cacert", "", "", "path of file that contains list of trusted TLS CAs")
cmd.Flags().StringP("cert", "", "", "path of file that contains X509 certificate in PEM format")
cmd.Flags().StringP("key", "", "", "path of file that contains X509 key in PEM format")
<<<<<<< HEAD

Check failure on line 90 in cmd/pd-server/main.go

View workflow job for this annotation

GitHub Actions / statics

syntax error: unexpected <<, expected }
=======
cmd.Flags().StringP("log-level", "L", "", "log level: debug, info, warn, error, fatal (default 'info')")
cmd.Flags().StringP("log-file", "", "", "log file path")
return cmd
}

// NewSchedulingServiceCommand returns the scheduling service command.
func NewSchedulingServiceCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "scheduling",
Short: "Run the scheduling service",
Run: scheduling.CreateServerWrapper,
}
cmd.Flags().BoolP("version", "V", false, "print version information and exit")
cmd.Flags().StringP("config", "", "", "config file")
cmd.Flags().StringP("backend-endpoints", "", "", "url for etcd client")
cmd.Flags().StringP("listen-addr", "", "", "listen address for tso service")
cmd.Flags().StringP("advertise-listen-addr", "", "", "advertise urls for listen address (default '${listen-addr}')")
cmd.Flags().StringP("cacert", "", "", "path of file that contains list of trusted TLS CAs")
cmd.Flags().StringP("cert", "", "", "path of file that contains X509 certificate in PEM format")
cmd.Flags().StringP("key", "", "", "path of file that contains X509 key in PEM format")
cmd.Flags().StringP("log-level", "L", "", "log level: debug, info, warn, error, fatal (default 'info')")
cmd.Flags().StringP("log-file", "", "", "log file path")
>>>>>>> de5bad370 (*: fix log level (#8118))

Check failure on line 114 in cmd/pd-server/main.go

View workflow job for this annotation

GitHub Actions / statics

syntax error: unexpected >>, expected }

Check failure on line 114 in cmd/pd-server/main.go

View workflow job for this annotation

GitHub Actions / statics

invalid character U+0023 '#'
return cmd
}

Expand All @@ -105,6 +130,11 @@ func NewResourceManagerServiceCommand() *cobra.Command {
cmd.Flags().StringP("cacert", "", "", "path of file that contains list of trusted TLS CAs")
cmd.Flags().StringP("cert", "", "", "path of file that contains X509 certificate in PEM format")
cmd.Flags().StringP("key", "", "", "path of file that contains X509 key in PEM format")
<<<<<<< HEAD

Check failure on line 133 in cmd/pd-server/main.go

View workflow job for this annotation

GitHub Actions / statics

syntax error: unexpected <<, expected }
=======
cmd.Flags().StringP("log-level", "L", "", "log level: debug, info, warn, error, fatal (default 'info')")
cmd.Flags().StringP("log-file", "", "", "log file path")
>>>>>>> de5bad370 (*: fix log level (#8118))

Check failure on line 137 in cmd/pd-server/main.go

View workflow job for this annotation

GitHub Actions / statics

invalid character U+0023 '#'
return cmd
}

Expand Down Expand Up @@ -132,7 +162,7 @@ func addFlags(cmd *cobra.Command) {
cmd.Flags().StringP("initial-cluster", "", "", "initial cluster configuration for bootstrapping, e,g. pd=http://127.0.0.1:2380")
cmd.Flags().StringP("join", "", "", "join to an existing cluster (usage: cluster's '${advertise-client-urls}'")
cmd.Flags().StringP("metrics-addr", "", "", "prometheus pushgateway address, leaves it empty will disable prometheus push")
cmd.Flags().StringP("log-level", "L", "info", "log level: debug, info, warn, error, fatal (default 'info')")
cmd.Flags().StringP("log-level", "L", "", "log level: debug, info, warn, error, fatal (default 'info')")
cmd.Flags().StringP("log-file", "", "", "log file path")
cmd.Flags().StringP("cacert", "", "", "path of file that contains list of trusted TLS CAs")
cmd.Flags().StringP("cert", "", "", "path of file that contains X509 certificate in PEM format")
Expand Down
6 changes: 2 additions & 4 deletions pkg/mcs/resource_manager/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ func (c *Config) Adjust(meta *toml.MetaData, reloading bool) error {
c.adjustLog(configMetaData.Child("log"))
c.Security.Encryption.Adjust()

if len(c.Log.Format) == 0 {
c.Log.Format = utils.DefaultLogFormat
}

c.Controller.Adjust(configMetaData.Child("controller"))
configutil.AdjustInt64(&c.LeaderLease, utils.DefaultLeaderLease)

Expand All @@ -233,6 +229,8 @@ func (c *Config) adjustLog(meta *configutil.ConfigMetaData) {
if !meta.IsDefined("disable-error-verbose") {
c.Log.DisableErrorVerbose = utils.DefaultDisableErrorVerbose
}
configutil.AdjustString(&c.Log.Format, utils.DefaultLogFormat)
configutil.AdjustString(&c.Log.Level, utils.DefaultLogLevel)
}

// GetTLSConfig returns the TLS config.
Expand Down
Loading

0 comments on commit db7175c

Please # to comment.