go_dreamfactory/modules/matchpool/options.go
2023-10-24 09:14:02 +08:00

31 lines
568 B
Go

package matchpool
import (
"errors"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/utils/mapstructure"
)
type (
Options struct {
Debug bool //日志是否开启
Log log.ILogger
}
)
func (this *Options) GetLog() log.ILogger {
return this.Log
}
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
this.Debug = false
if settings != nil {
err = mapstructure.Decode(settings, this)
}
if this.Log = log.NewTurnlog(this.Debug, log.Clone("matchpool", 4)); this.Log == nil {
err = errors.New("log is nil")
}
return
}