restructure

This commit is contained in:
yanghao05
2023-04-20 12:11:34 +08:00
parent 6757e00d73
commit 5b8eca5d87
120 changed files with 546 additions and 7303 deletions

View File

@@ -2,20 +2,18 @@ package log
import (
"strings"
"go.uber.org/zap/zapcore"
)
type LevelWriter struct {
Level zapcore.Level
Level Level
}
func (w LevelWriter) Write(p []byte) (n int, err error) {
str := strings.TrimSpace(string(p))
switch w.Level {
case zapcore.InfoLevel:
case InfoLevel:
Info(str)
case zapcore.ErrorLevel:
case ErrorLevel:
Error(str)
}
return len(p), nil