refactor: around CheckHTTPHealth (#1139)
This commit is contained in:
		@@ -26,10 +26,11 @@ func init() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewCustomLogger creates logrus
 | 
			
		||||
func NewCustomLogger(c config.ServerInfo) *logrus.Entry {
 | 
			
		||||
func NewCustomLogger(server config.ServerInfo) *logrus.Entry {
 | 
			
		||||
	log := logrus.New()
 | 
			
		||||
	log.Formatter = &formatter.TextFormatter{MsgAnsiColor: c.LogMsgAnsiColor}
 | 
			
		||||
	log.Formatter = &formatter.TextFormatter{MsgAnsiColor: server.LogMsgAnsiColor}
 | 
			
		||||
	log.Level = logrus.InfoLevel
 | 
			
		||||
	//TODO passed by arg
 | 
			
		||||
	if config.Conf.Debug {
 | 
			
		||||
		log.Level = logrus.DebugLevel
 | 
			
		||||
	}
 | 
			
		||||
@@ -64,8 +65,8 @@ func NewCustomLogger(c config.ServerInfo) *logrus.Entry {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	whereami := "localhost"
 | 
			
		||||
	if 0 < len(c.ServerName) {
 | 
			
		||||
		whereami = c.GetServerName()
 | 
			
		||||
	if 0 < len(server.ServerName) {
 | 
			
		||||
		whereami = server.GetServerName()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if _, err := os.Stat(logDir); err == nil {
 | 
			
		||||
 
 | 
			
		||||
@@ -127,7 +127,7 @@ func ProxyEnv() string {
 | 
			
		||||
 | 
			
		||||
// PrependProxyEnv prepends proxy environment variable
 | 
			
		||||
func PrependProxyEnv(cmd string) string {
 | 
			
		||||
	if len(config.Conf.HTTPProxy) == 0 {
 | 
			
		||||
	if config.Conf.HTTPProxy == "" {
 | 
			
		||||
		return cmd
 | 
			
		||||
	}
 | 
			
		||||
	return fmt.Sprintf("%s %s", ProxyEnv(), cmd)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user