let http.Server use the main app logger
This commit is contained in:
@ -42,20 +42,23 @@ type ClientTLSConfig struct {
|
||||
|
||||
type ServerConfig struct {
|
||||
CTL struct {
|
||||
TLS ServerTLSConfig `yaml:"tls"`
|
||||
TLS ServerTLSConfig `yaml:"tls"`
|
||||
ServiceAddrs []string `yaml:"service-addrs"`
|
||||
} `yaml:"ctl"`
|
||||
|
||||
RPC struct {
|
||||
TLS ServerTLSConfig `yaml:"tls"`
|
||||
TLS ServerTLSConfig `yaml:"tls"`
|
||||
ServiceAddrs []string `yaml:"service-addrs"`
|
||||
} `yaml:"rpc"`
|
||||
}
|
||||
|
||||
type ClientConfig struct {
|
||||
CTL struct {
|
||||
TLS ServerTLSConfig `yaml:"tls"`
|
||||
TLS ServerTLSConfig `yaml:"tls"`
|
||||
ServiceAddrs []string `yaml:"service-addrs"`
|
||||
} `yaml:"ctl"`
|
||||
RPC struct {
|
||||
TLS ClientTLSConfig `yaml:"tls"`
|
||||
TLS ClientTLSConfig `yaml:"tls"`
|
||||
} `yaml:"rpc"`
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ func main() {
|
||||
goto wrong_usage
|
||||
}
|
||||
|
||||
if len(rpc_addrs) < 1 || flgs.NArg() > 0 {
|
||||
if len(rpc_addrs) <= 0 || flgs.NArg() > 0 {
|
||||
goto wrong_usage
|
||||
}
|
||||
|
||||
@ -263,6 +263,8 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if len(ctl_addrs) <= 0 { ctl_addrs = cfg.CTL.ServiceAddrs }
|
||||
|
||||
err = server_main(ctl_addrs, rpc_addrs, cfg)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: server error - %s\n", err.Error())
|
||||
@ -297,7 +299,7 @@ func main() {
|
||||
goto wrong_usage
|
||||
}
|
||||
|
||||
if len(rpc_addrs) < 1 {
|
||||
if len(rpc_addrs) <= 0 {
|
||||
goto wrong_usage
|
||||
}
|
||||
|
||||
@ -309,6 +311,8 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if len(ctl_addrs) < 1 { ctl_addrs = cfg.CTL.ServiceAddrs }
|
||||
|
||||
err = client_main(ctl_addrs, rpc_addrs[0], flgs.Args(), cfg)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: client error - %s\n", err.Error())
|
||||
|
Reference in New Issue
Block a user