Skip to content

Commit

Permalink
eliminate duplication by calling DebugEnabled from Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
evanj committed Mar 1, 2022
1 parent 94c09c9 commit f20206e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/log/log.go
Expand Up @@ -67,10 +67,7 @@ func DebugEnabled() bool {

// Debug prints the given message if the level is LevelDebug.
func Debug(fmt string, a ...interface{}) {
mu.RLock()
lvl := level
mu.RUnlock()
if lvl != LevelDebug {
if !DebugEnabled() {
return
}
printMsg("DEBUG", fmt, a...)
Expand Down

0 comments on commit f20206e

Please sign in to comment.