Browse Source

perf: avoid exposure of zapcore

dev
Dnomd343 11 months ago
parent
commit
506ad861fe
  1. 6
      logger/interface.go

6
logger/interface.go

@ -5,6 +5,8 @@ import (
"io"
)
type Level = zapcore.Level
const (
DebugLevel = zapcore.DebugLevel
InfoLevel = zapcore.InfoLevel
@ -34,13 +36,13 @@ func Panicf(template string, args ...interface{}) {
}
// GetLevel return the current logger level.
func GetLevel() zapcore.Level {
func GetLevel() Level {
return logger.level.Level()
}
// SetLevel configure logger output level. Note that debug level will output
// more information and reduce performance.
func SetLevel(level zapcore.Level) {
func SetLevel(level Level) {
logger.level.SetLevel(level)
if level == DebugLevel {
logger.verbose = true

Loading…
Cancel
Save