fix LevelInfo > LevelWarn (#1162)
This commit is contained in:
parent
8d44f7226f
commit
12181bd441
@ -4,19 +4,20 @@ package log
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/micro/go-micro/v2/debug/log"
|
"github.com/micro/go-micro/v2/debug/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// level is a log level
|
// level is a log level
|
||||||
type Level int
|
type Level int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
LevelFatal Level = iota
|
LevelFatal Level = iota
|
||||||
LevelError
|
LevelError
|
||||||
LevelInfo
|
|
||||||
LevelWarn
|
LevelWarn
|
||||||
|
LevelInfo
|
||||||
LevelDebug
|
LevelDebug
|
||||||
LevelTrace
|
LevelTrace
|
||||||
)
|
)
|
||||||
@ -186,7 +187,7 @@ func GetLogger() log.Log {
|
|||||||
|
|
||||||
// SetLevel sets the log level
|
// SetLevel sets the log level
|
||||||
func SetLevel(l Level) {
|
func SetLevel(l Level) {
|
||||||
level = l
|
atomic.StoreInt32((*int32)(&level), int32(l))
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLevel returns the current level
|
// GetLevel returns the current level
|
||||||
|
Loading…
Reference in New Issue
Block a user