fix logger new

This commit is contained in:
2025-10-16 13:29:25 +08:00
parent 179157f49e
commit 42e9d55b62
2 changed files with 17 additions and 26 deletions

View File

@@ -41,6 +41,23 @@ var (
once sync.Once
)
// 初始化Logger配置
func New(cfg *conf.LogConf) {
if cfg == nil {
cfg = &conf.LogConf{
Name: strings.ToLower(vars.ServiceKey),
Level: vars.LogLevel(vars.DEBUG),
Dir: "./logs/",
Endpoint: "",
Console: true,
File: true,
Remote: false,
}
}
InitLogger(cfg)
}
// InitLogger 初始化全局日志器
func InitLogger(cfg *conf.LogConf) error {
var err error