diff --git a/internal/util/paramtable/base_table.go b/internal/util/paramtable/base_table.go index 115073cf831f86bb02b4db6f22f91e1a159892ec..aa934cb8f0a256726d15766593a725a94c6b091f 100644 --- a/internal/util/paramtable/base_table.go +++ b/internal/util/paramtable/base_table.go @@ -425,6 +425,7 @@ func ConvertRangeToIntRange(rangeStr, sep string) []int { return []int{start, end} } +// ConvertRangeToIntSlice convert given @rangeStr & @sep to a slice of ints. func ConvertRangeToIntSlice(rangeStr, sep string) []int { rangeSlice := ConvertRangeToIntRange(rangeStr, sep) start, end := rangeSlice[0], rangeSlice[1] @@ -435,6 +436,7 @@ func ConvertRangeToIntSlice(rangeStr, sep string) []int { return ret } +// InitLogCfg init log of the base table func (gp *BaseTable) InitLogCfg() { gp.Log = log.Config{} format, err := gp.Load("log.format") @@ -452,6 +454,7 @@ func (gp *BaseTable) InitLogCfg() { gp.Log.File.MaxDays = gp.ParseInt("log.file.maxAge") } +// SetLogConfig set log config of the base table func (gp *BaseTable) SetLogConfig() { gp.LogCfgFunc = func(cfg log.Config) { log.Info("Set log file to ", zap.String("path", cfg.File.Filename)) @@ -460,6 +463,7 @@ func (gp *BaseTable) SetLogConfig() { } } +// SetLogger sets the logger file by given id func (gp *BaseTable) SetLogger(id UniqueID) { rootPath, err := gp.Load("log.file.rootPath") if err != nil {