add conf.PrintInfo
This commit is contained in:
		
							parent
							
								
									e184fff689
								
							
						
					
					
						commit
						04451d4b2f
					
				| 
						 | 
					@ -29,7 +29,9 @@ func New(srvKey string, cfg any) {
 | 
				
			||||||
	// 构造配置文件路径,输出配置文件信息
 | 
						// 构造配置文件路径,输出配置文件信息
 | 
				
			||||||
	cfp := fmt.Sprintf("%s_%s.yaml", strings.ToLower(srvKey), env.Runtime.Mode)
 | 
						cfp := fmt.Sprintf("%s_%s.yaml", strings.ToLower(srvKey), env.Runtime.Mode)
 | 
				
			||||||
	cfp = filepath.Join(env.Runtime.Prefix, "etc", cfp)
 | 
						cfp = filepath.Join(env.Runtime.Prefix, "etc", cfp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	print.Info("[BSM - %s] Config File: %s", srvKey, cfp)
 | 
						print.Info("[BSM - %s] Config File: %s", srvKey, cfp)
 | 
				
			||||||
 | 
						print.Info("[BSM - %s] Check Configure ...", vars.ServiceKey)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// 读取配置文件内容
 | 
						// 读取配置文件内容
 | 
				
			||||||
	yamlFile, err := os.ReadFile(cfp)
 | 
						yamlFile, err := os.ReadFile(cfp)
 | 
				
			||||||
| 
						 | 
					@ -58,6 +60,7 @@ func NotNil(values ...string) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func PrintInfo(port int) {
 | 
					func PrintInfo(port int) {
 | 
				
			||||||
 | 
						print.Success("[BSM - %s] Config Check Success.", vars.ServiceKey)
 | 
				
			||||||
	print.Info("[BSM - %s] Service Name: %s", vars.ServiceKey, vars.ServiceKey)
 | 
						print.Info("[BSM - %s] Service Name: %s", vars.ServiceKey, vars.ServiceKey)
 | 
				
			||||||
	print.Info("[BSM - %s] Runtime Mode: %s", vars.ServiceKey, env.Runtime.Mode)
 | 
						print.Info("[BSM - %s] Runtime Mode: %s", vars.ServiceKey, env.Runtime.Mode)
 | 
				
			||||||
	print.Info("[BSM - %s] Listen Addr: %s:%d", vars.ServiceKey, utils.GetLocationIP(), port)
 | 
						print.Info("[BSM - %s] Listen Addr: %s:%d", vars.ServiceKey, utils.GetLocationIP(), port)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue