优化日志
This commit is contained in:
parent
41c32e5fa7
commit
2217959df3
@ -16,6 +16,7 @@ func initRepo() {
|
||||
}
|
||||
|
||||
func Run(GitCommit, GitBranch, BuildDate string) {
|
||||
config.InitLog()
|
||||
config.LoadConfig(GitCommit, GitBranch, BuildDate)
|
||||
log.Info(fmt.Sprintf("版本分支:%v,hash值:%v,编译时间:%v", GitBranch, GitCommit, BuildDate))
|
||||
initRepo()
|
||||
|
@ -12,13 +12,13 @@ var Cfg *config.Common[ChatConfig]
|
||||
type ChatConfig struct {
|
||||
}
|
||||
|
||||
func initLog() {
|
||||
func InitLog() {
|
||||
log.Open("./log/chat.log", log.DebugL)
|
||||
log.Info("\n\n\ninit log success")
|
||||
}
|
||||
|
||||
func LoadConfig(GitCommit, GitBranch, BuildDate string) {
|
||||
Command = config.ParseCommand()
|
||||
initLog()
|
||||
rdb, err := db.InitRedis(Command.RedisPassword, Command.RedisHost, Command.RedisPort, 0)
|
||||
if err != nil {
|
||||
log.Error(err.Error())
|
||||
|
@ -16,6 +16,7 @@ func initRepo() {
|
||||
}
|
||||
|
||||
func Run(GitCommit, GitBranch, BuildDate string) {
|
||||
config.InitLog()
|
||||
config.LoadConfig(GitCommit, GitBranch, BuildDate)
|
||||
log.Info(fmt.Sprintf("版本分支:%v,hash值:%v,编译时间:%v", GitBranch, GitCommit, BuildDate))
|
||||
initRepo()
|
||||
|
@ -21,13 +21,13 @@ type GateConfig struct {
|
||||
Address []string `json:"address"` // 网关地址
|
||||
}
|
||||
|
||||
func initLog() {
|
||||
func InitLog() {
|
||||
log.Open("./log/gate.log", log.DebugL)
|
||||
log.Info("\n\n\ninit log success")
|
||||
}
|
||||
|
||||
func LoadConfig(GitCommit, GitBranch, BuildDate string) {
|
||||
Command = config.ParseCommand()
|
||||
initLog()
|
||||
rdb, err := db.InitRedis(Command.RedisPassword, Command.RedisHost, Command.RedisPort, 0)
|
||||
if err != nil {
|
||||
log.Error(err.Error())
|
||||
|
@ -17,6 +17,7 @@ func initRepo() {
|
||||
}
|
||||
|
||||
func Run(GitCommit, GitBranch, BuildDate string) {
|
||||
config.InitLog()
|
||||
config.LoadConfig(GitCommit, GitBranch, BuildDate)
|
||||
log.Info(fmt.Sprintf("版本分支:%v,hash值:%v,编译时间:%v", GitBranch, GitCommit, BuildDate))
|
||||
initRepo()
|
||||
|
@ -12,13 +12,13 @@ var Cfg *config.Common[LoginConfig]
|
||||
type LoginConfig struct {
|
||||
}
|
||||
|
||||
func initLog() {
|
||||
func InitLog() {
|
||||
log.Open("./log/login.log", log.DebugL)
|
||||
log.Info("\n\n\ninit log success")
|
||||
}
|
||||
|
||||
func LoadConfig(GitCommit, GitBranch, BuildDate string) {
|
||||
Command = config.ParseCommand()
|
||||
initLog()
|
||||
rdb, err := db.InitRedis(Command.RedisPassword, Command.RedisHost, Command.RedisPort, 0)
|
||||
if err != nil {
|
||||
log.Error(err.Error())
|
||||
|
Loading…
x
Reference in New Issue
Block a user