refactor(logging): 统一使用自定义Loger替代g.Log()日志记录

This commit is contained in:
1
2025-07-26 03:48:06 +00:00
parent dcc5ef047c
commit 5d2b48ccc0
26 changed files with 72 additions and 73 deletions

View File

@@ -2,13 +2,13 @@ package rpc
import (
"blazing/common/data/share"
"blazing/cool"
"context"
"fmt"
"log"
"net/http"
"github.com/filecoin-project/go-jsonrpc"
"github.com/gogf/gf/v2/frame/g"
)
const rpcaddr = "127.0.0.1:40000"
@@ -71,13 +71,13 @@ func StartServer() {
rpcServer := jsonrpc.NewServer(jsonrpc.WithReverseClient[ClientHandler](""))
rpcServer.Register("", &ServerHandler{})
g.Log().Debug(context.Background(), "jsonrpc server start")
cool.Loger.Debug(context.Background(), "jsonrpc server start")
// go time.AfterFunc(3000, func() {
// testjsonrpc()
// })
err := http.ListenAndServe(rpcaddr, rpcServer)
g.Log().Debug(context.Background(), "jsonrpc server fail", err)
cool.Loger.Debug(context.Background(), "jsonrpc server fail", err)
}
var closer jsonrpc.ClientCloser