mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 07:26:36 +08:00
feat: 重构日志处理,使用slog包替换原有日志函数,增强日志记录能力
This commit is contained in:
@@ -192,25 +192,6 @@ func SetupGinLog() {
|
||||
ensureLogger()
|
||||
}
|
||||
|
||||
func SysLog(s string) {
|
||||
if !shouldLog(logLevelInfo) {
|
||||
return
|
||||
}
|
||||
ensureLogger().Info(s)
|
||||
}
|
||||
|
||||
func SysError(s string) {
|
||||
if !shouldLog(logLevelError) {
|
||||
return
|
||||
}
|
||||
ensureLogger().Error(s)
|
||||
}
|
||||
|
||||
func FatalLog(v ...any) {
|
||||
ensureLogger().Error("fatal error", "details", v)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
func levelLabel(level slog.Level) string {
|
||||
switch {
|
||||
case level <= slog.LevelDebug:
|
||||
|
||||
Reference in New Issue
Block a user