mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
log: fix staticcheck warnings (#20388)
This commit is contained in:
parent
6873ca0687
commit
4d9936574b
1 changed files with 3 additions and 3 deletions
|
|
@ -207,7 +207,7 @@ func (h *GlogHandler) Log(r *Record) error {
|
||||||
}
|
}
|
||||||
// Check callsite cache for previously calculated log levels
|
// Check callsite cache for previously calculated log levels
|
||||||
h.lock.RLock()
|
h.lock.RLock()
|
||||||
lvl, ok := h.siteCache[r.Call.PC()]
|
lvl, ok := h.siteCache[r.Call.Frame().PC]
|
||||||
h.lock.RUnlock()
|
h.lock.RUnlock()
|
||||||
|
|
||||||
// If we didn't cache the callsite yet, calculate it
|
// If we didn't cache the callsite yet, calculate it
|
||||||
|
|
@ -215,13 +215,13 @@ func (h *GlogHandler) Log(r *Record) error {
|
||||||
h.lock.Lock()
|
h.lock.Lock()
|
||||||
for _, rule := range h.patterns {
|
for _, rule := range h.patterns {
|
||||||
if rule.pattern.MatchString(fmt.Sprintf("%+s", r.Call)) {
|
if rule.pattern.MatchString(fmt.Sprintf("%+s", r.Call)) {
|
||||||
h.siteCache[r.Call.PC()], lvl, ok = rule.level, rule.level, true
|
h.siteCache[r.Call.Frame().PC], lvl, ok = rule.level, rule.level, true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If no rule matched, remember to drop log the next time
|
// If no rule matched, remember to drop log the next time
|
||||||
if !ok {
|
if !ok {
|
||||||
h.siteCache[r.Call.PC()] = 0
|
h.siteCache[r.Call.Frame().PC] = 0
|
||||||
}
|
}
|
||||||
h.lock.Unlock()
|
h.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue