Skip to content

Commit bcd992c

Browse files
committed
maxcache: add logging
1 parent dd71d70 commit bcd992c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/maxcache/store.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"path/filepath"
1010
"strings"
1111
"sync"
12+
13+
"go.uber.org/zap"
1214
)
1315

1416
const (
@@ -92,6 +94,7 @@ func (s *Store) Update(key string, value int) error {
9294
next = value
9395
}
9496
if next == current {
97+
zap.L().Debug("max not updated", zap.String("key", key), zap.Int("value", value), zap.Int("next", next))
9598
return nil
9699
}
97100

@@ -134,6 +137,7 @@ func (s *Store) load() error {
134137
}
135138

136139
s.values[key] = rec.Max
140+
zap.L().Info("max loaded", zap.String("key", key), zap.Int("value", rec.Max))
137141
}
138142

139143
return errs
@@ -176,6 +180,7 @@ func (s *Store) write(key string, value int) error {
176180
}
177181

178182
removeTmp = false
183+
zap.L().Info("max update written", zap.String("key", key), zap.Int("value", value))
179184
return nil
180185
}
181186

0 commit comments

Comments
 (0)