refactor(logging): replace all print/log with structured slog logger
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled

- 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:
Aska committed 2026-08-12 21:31:06 +08:00
1 parent 628d416dcd
commit a58ec7325d
8 files changed
+55 -50

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@ package ws
import (
"context"
"encoding/json"
"log"
"git.yeij.top/AskaEth/Cyrene_v2/internal/logger"
"net/http"
"sync"
@@ -76,7 +76,7 @@ func (h *Hub) run() {
h.clients[c] = true
n := len(h.clients)
h.mu.Unlock()
log.Printf("[ws] client connected (total=%d)", n)
logger.Infof("[ws] client connected (total=%d)", n)
case c := <-h.unregister:
h.mu.Lock()
@@ -103,7 +103,7 @@ func (h *Hub) run() {
func (h *Hub) HandleUpgrade(w http.ResponseWriter, r *http.Request) {
conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
log.Printf("[ws] upgrade error: %v", err)
logger.Infof("[ws] upgrade error: %v", err)
return
}