fix: rename default log

This commit is contained in:
王荣昌 2024-04-07 14:19:18 +08:00
parent cb83d7a04c
commit 22729da9f5

View File

@ -17,8 +17,8 @@ func init() {
}
func MustNewKisDefaultSlog(opts ...KisLogOptions) {
initDefaultSlog(loadKisDefaultLog(opts...))
SetLogger(&kisDefaultSlog{})
defaultSlog := getKisDefaultSLog(opts...)
SetLogger(defaultSlog)
}
// kisDefaultSlog 默认提供的日志对象
@ -64,17 +64,18 @@ var defaultKisLog = &kisDefaultSlog{
writer: os.Stdout,
}
func loadKisDefaultLog(opts ...KisLogOptions) *kisDefaultSlog {
kisLog := defaultKisLog
func getKisDefaultSLog(opts ...KisLogOptions) *kisDefaultSlog {
defaultKisSlog := defaultKisLog
if opts == nil {
return kisLog
return defaultKisSlog
}
for _, opt := range opts {
opt(kisLog)
opt(defaultKisSlog)
}
return kisLog
initDefaultSlog(defaultKisSlog)
return defaultKisSlog
}
func (k *kisDefaultSlog) InfoFX(ctx context.Context, str string, v ...interface{}) {