Skip to content

Commit 4d99365

Browse files
committed
log: fix staticcheck warnings (ethereum#20388)
1 parent 6873ca0 commit 4d99365

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

log/handler_glog.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,21 @@ func (h *GlogHandler) Log(r *Record) error {
207207
}
208208
// Check callsite cache for previously calculated log levels
209209
h.lock.RLock()
210-
lvl, ok := h.siteCache[r.Call.PC()]
210+
lvl, ok := h.siteCache[r.Call.Frame().PC]
211211
h.lock.RUnlock()
212212

213213
// If we didn't cache the callsite yet, calculate it
214214
if !ok {
215215
h.lock.Lock()
216216
for _, rule := range h.patterns {
217217
if rule.pattern.MatchString(fmt.Sprintf("%+s", r.Call)) {
218-
h.siteCache[r.Call.PC()], lvl, ok = rule.level, rule.level, true
218+
h.siteCache[r.Call.Frame().PC], lvl, ok = rule.level, rule.level, true
219219
break
220220
}
221221
}
222222
// If no rule matched, remember to drop log the next time
223223
if !ok {
224-
h.siteCache[r.Call.PC()] = 0
224+
h.siteCache[r.Call.Frame().PC] = 0
225225
}
226226
h.lock.Unlock()
227227
}

0 commit comments

Comments
 (0)