refactor(logging): replace all print/log with structured slog logger
- main.go: 30+ log.Printf → logger.Infof - plugin/registry: 12 log.Printf → logger.Infof - db/db.go, ws/hub.go: log → logger - platform-bridge: fmt.Printf/println → logger.Info - Logs now: time=... level=INFO msg=... - 16 packages pass, vet clean
This commit is contained in:
1 parent
628d416dcd
commit
a58ec7325d
8 files changed
+55
-50
No files matched your search
@@ -2,7 +2,11 @@
|
||||
// It defines unified message types and adapter interfaces for QQ, Telegram, Discord, and Webhook.
|
||||
package bridge
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/logger"
|
||||
)
|
||||
|
||||
// UnifiedMessage is the internal representation of a message from any platform.
|
||||
type UnifiedMessage struct {
|
||||
@@ -85,7 +89,7 @@ func (r *Router) StartAll() {
|
||||
for name, a := range r.adapters {
|
||||
go func(name string, a Adapter) {
|
||||
if err := a.Start(); err != nil {
|
||||
println("[bridge]", name, "start error:", err.Error())
|
||||
logger.Info("[bridge]", name, "start error:", err.Error())
|
||||
return
|
||||
}
|
||||
for msg := range a.Incoming() {
|
||||
|
||||
Reference in new issue
Block a user