Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
9a529d64
Commit
9a529d64
authored
5 years ago
by
Guillaume Ballet
Committed by
Felix Lange
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log: fix staticcheck warnings (#20388)
parent
a91b704b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
handler_glog.go
log/handler_glog.go
+3
-3
logger.go
log/logger.go
+1
-1
No files found.
log/handler_glog.go
View file @
9a529d64
...
...
@@ -207,7 +207,7 @@ func (h *GlogHandler) Log(r *Record) error {
}
// Check callsite cache for previously calculated log levels
h
.
lock
.
RLock
()
lvl
,
ok
:=
h
.
siteCache
[
r
.
Call
.
PC
()
]
lvl
,
ok
:=
h
.
siteCache
[
r
.
Call
.
Frame
()
.
PC
]
h
.
lock
.
RUnlock
()
// If we didn't cache the callsite yet, calculate it
...
...
@@ -215,13 +215,13 @@ func (h *GlogHandler) Log(r *Record) error {
h
.
lock
.
Lock
()
for
_
,
rule
:=
range
h
.
patterns
{
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
}
}
// If no rule matched, remember to drop log the next time
if
!
ok
{
h
.
siteCache
[
r
.
Call
.
PC
()
]
=
0
h
.
siteCache
[
r
.
Call
.
Frame
()
.
PC
]
=
0
}
h
.
lock
.
Unlock
()
}
...
...
This diff is collapsed.
Click to expand it.
log/logger.go
View file @
9a529d64
...
...
@@ -83,7 +83,7 @@ func LvlFromString(lvlString string) (Lvl, error) {
case
"crit"
:
return
LvlCrit
,
nil
default
:
return
LvlDebug
,
fmt
.
Errorf
(
"
U
nknown level: %v"
,
lvlString
)
return
LvlDebug
,
fmt
.
Errorf
(
"
u
nknown level: %v"
,
lvlString
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment