diff --git a/uid.go b/uid.go index a7be50b..5a37361 100644 --- a/uid.go +++ b/uid.go @@ -100,8 +100,8 @@ func (idg *idCreator) backgroudTaskForGenerateRange() { // doing range generator for i := 0; ; i++ { + logStr := "" log.SetLogid(fmt.Sprintf("uidcreator%07d", i)) - log.PrintPretty("backgroud info, ranges:", idg.Ranges) for prefix, queue := range idg.Ranges { var qlen = queue.Len() var timeoutMs = 1 * time.Millisecond @@ -120,6 +120,12 @@ func (idg *idCreator) backgroudTaskForGenerateRange() { } else if int(timeoutMs) < 0 { time.Sleep(-timeoutMs) } + if i%50 == 0 { + logStr += fmt.Sprintf("queue-legth:(%s,%d);", prefix, queue.Len()) + } + } + if i%50 == 0 { + log.Infof("backgroud idcreator info: %s", logStr) } time.Sleep(3000 * time.Millisecond) }