fix logger bug

This commit is contained in:
2025-10-04 17:42:26 +08:00
parent 464617626b
commit 5584757ff4
4 changed files with 50 additions and 30 deletions

View File

@@ -104,3 +104,19 @@ func CheckIP(ip string) string {
}
return ip
}
// 初始化Logger配置
func InitLoggerConf(cfg *LogConf) *LogConf {
if cfg == nil {
return &LogConf{
Name: strings.ToLower(vars.ServiceKey),
Level: vars.LogLevel(vars.DEBUG),
Dir: cfg.Dir,
Endpoint: cfg.Endpoint,
Console: cfg.Console,
File: cfg.File,
Remote: cfg.Remote,
}
}
return cfg
}