Skip to content

Commit 0597224

Browse files
authored
fix(core): logger shouldLog checking lower log level (#1483)
1 parent 6505d08 commit 0597224

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

logger/default_logger.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type loggerT struct {
2222
// Not mutex-protected, should be called before any scaleway-sdk-go functions.
2323
func (g *loggerT) Init(w io.Writer, level LogLevel) {
2424
g.m = newLogger(w, level).m
25+
g.v = level
2526
}
2627

2728
// Debugf logs to the DEBUG log. Arguments are handled in the manner of fmt.Printf.
@@ -51,7 +52,7 @@ func (g *loggerT) Errorf(format string, args ...interface{}) {
5152
// ShouldLog reports whether verbosity level l is at least the requested verbose level.
5253
func ShouldLog(level LogLevel) bool { return logger.ShouldLog(level) }
5354
func (g *loggerT) ShouldLog(level LogLevel) bool {
54-
return level <= g.v
55+
return level >= g.v
5556
}
5657

5758
func isEnabled(envKey string) bool {

0 commit comments

Comments
 (0)