替换slog日志为zap

This commit is contained in:
duanhf2012
2024-11-29 13:47:27 +08:00
parent 000853b479
commit 61de4bba3a
33 changed files with 404 additions and 913 deletions

View File

@@ -3,7 +3,6 @@ package event
import (
"fmt"
"github.com/duanhf2012/origin/v2/log"
"runtime"
"sync"
)
@@ -215,10 +214,7 @@ func (handler *EventHandler) Destroy() {
func (processor *EventProcessor) EventHandler(ev IEvent) {
defer func() {
if r := recover(); r != nil {
buf := make([]byte, 4096)
l := runtime.Stack(buf, false)
errString := fmt.Sprint(r)
log.Dump(string(buf[:l]), log.String("error", errString))
log.StackError(fmt.Sprint(r))
}
}()