Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

2 changed files with 26 additions and 17 deletions

View File

@ -41,23 +41,6 @@ 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

26
with/logger.go Normal file
View File

@ -0,0 +1,26 @@
package with
import (
"strings"
"git.apinb.com/bsm-sdk/core/conf"
"git.apinb.com/bsm-sdk/core/logger"
"git.apinb.com/bsm-sdk/core/vars"
)
// 初始化Logger配置
func Logger(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,
}
}
logger.InitLogger(cfg)
}