This repository has been archived on 2026-01-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Game/Server/common/log/level.go
2025-06-25 00:01:48 +08:00

24 lines
461 B
Go

package log
import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var logLevelMap = map[string]zapcore.Level{
"panic": zap.DPanicLevel,
"fatal": zap.FatalLevel,
"error": zap.ErrorLevel,
"warn": zap.WarnLevel,
"info": zap.InfoLevel,
"debug": zap.DebugLevel,
}
// GetLogLevel get the logLevel from logLevelName
func GetLogLevel(logLevelName string) zapcore.Level {
if v, ok := logLevelMap[logLevelName]; ok {
return v
}
return zap.DebugLevel
}