Lines Matching refs:cacheEntries
26 cacheEntries []string var
36 if cacheEntries != nil {
43 cacheEntries = make([]string, maxLines)
51 for i := range cacheEntries {
52 pos := (cachePos + i) % len(cacheEntries)
53 if cacheEntries[pos] == "" {
56 buf.WriteString(cacheEntries[pos])
65 if cacheEntries != nil && v <= 1 {
66 cacheMem -= len(cacheEntries[cachePos])
74 cacheEntries[cachePos] = fmt.Sprintf(timeStr+msg, args...)
75 cacheMem += len(cacheEntries[cachePos])
77 if cachePos == len(cacheEntries) {
80 for i := 0; i < len(cacheEntries)-1 && cacheMem > cacheMaxMem; i++ {
81 pos := (cachePos + i) % len(cacheEntries)
82 cacheMem -= len(cacheEntries[pos])
83 cacheEntries[pos] = ""