Adding SetLevel function to FieldLogger

This commit is contained in:
Dongming Bi 2020-11-19 20:46:33 -08:00
parent 95e784aa4d
commit 6abeffb8b1
No known key found for this signature in database
GPG Key ID: AE7B02B3C7564435
2 changed files with 5 additions and 0 deletions

View File

@ -278,6 +278,10 @@ func (entry *Entry) write() {
} }
} }
func (entry *Entry) SetLevel(level Level) {
entry.Logger.SetLevel(level)
}
func (entry *Entry) IsLevelEnabled(level Level) bool { func (entry *Entry) IsLevelEnabled(level Level) bool {
return entry.Logger.IsLevelEnabled(level) return entry.Logger.IsLevelEnabled(level)
} }

View File

@ -168,6 +168,7 @@ type FieldLogger interface {
Fatalln(args ...interface{}) Fatalln(args ...interface{})
Panicln(args ...interface{}) Panicln(args ...interface{})
SetLevel(level Level)
IsLevelEnabled(level Level) bool IsLevelEnabled(level Level) bool
// IsDebugEnabled() bool // IsDebugEnabled() bool
// IsInfoEnabled() bool // IsInfoEnabled() bool