[Race] Fix datarace in GetLevel
`std.Level` is protected by mutex in setter (SetLevel), so it must be protected in geetter (GetLevel) too. Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
This commit is contained in:
@@ -36,6 +36,8 @@ func SetLevel(level Level) {
|
||||
|
||||
// GetLevel returns the standard logger level.
|
||||
func GetLevel() Level {
|
||||
std.mu.Lock()
|
||||
defer std.mu.Unlock()
|
||||
return std.Level
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user