diff --git a/plugin/dapp/cross2eth/ebrelayer/main.go b/plugin/dapp/cross2eth/ebrelayer/main.go index 819b804724..f6faff89bb 100644 --- a/plugin/dapp/cross2eth/ebrelayer/main.go +++ b/plugin/dapp/cross2eth/ebrelayer/main.go @@ -27,7 +27,6 @@ import ( relayerTypes "github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/types" tml "github.com/BurntSushi/toml" "github.com/btcsuite/btcd/limits" - "github.com/prometheus/common/log" ) var ( @@ -56,26 +55,26 @@ func main() { if err != nil { panic(err) } - log.Info("current dir:", "dir", d) + mainlog.Info("current dir:", "dir", d) err = limits.SetLimits() if err != nil { panic(err) } cfg := initCfg(*configPath) - log.Info("Starting FUZAMEI Chain33-X-Ethereum relayer software:", "\n Name: ", cfg.Title) + mainlog.Info("Starting FUZAMEI Chain33-X-Ethereum relayer software:", "\n Name: ", cfg.Title) logf.SetFileLog(convertLogCfg(cfg.Log)) ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup - log.Info("db info:", " Dbdriver = ", cfg.SyncTxConfig.Dbdriver, ", DbPath = ", cfg.SyncTxConfig.DbPath, ", DbCache = ", cfg.SyncTxConfig.DbCache) - log.Info("deploy info:", "BridgeRegistry", cfg.BridgeRegistry) + mainlog.Info("db info:", " Dbdriver = ", cfg.SyncTxConfig.Dbdriver, ", DbPath = ", cfg.SyncTxConfig.DbPath, ", DbCache = ", cfg.SyncTxConfig.DbCache) + mainlog.Info("deploy info:", "BridgeRegistry", cfg.BridgeRegistry) mainlog.Info("db info:", " Dbdriver = ", cfg.SyncTxConfig.Dbdriver, ", DbPath = ", cfg.SyncTxConfig.DbPath, ", DbCache = ", cfg.SyncTxConfig.DbCache) db := dbm.NewDB("relayer_db_service", cfg.SyncTxConfig.Dbdriver, cfg.SyncTxConfig.DbPath, cfg.SyncTxConfig.DbCache) ethBridgeClaimChan := make(chan *ebrelayerTypes.EthBridgeClaim, 100) chain33MsgChan := make(chan *events.Chain33Msg, 100) - log.Info("deploy info for chain33:", "cfg.Deploy4Chain33", cfg.Deploy4Chain33) + mainlog.Info("deploy info for chain33:", "cfg.Deploy4Chain33", cfg.Deploy4Chain33) chain33StartPara := &chain33Relayer.Chain33StartPara{ ChainName: cfg.ChainName, Ctx: ctx, @@ -103,7 +102,7 @@ func main() { relayerManager := relayer.NewRelayerManager(chain33RelayerService, ethRelayerService, db) - log.Info("cfg.JrpcBindAddr = ", cfg.JrpcBindAddr) + mainlog.Info("cfg.JrpcBindAddr = ", cfg.JrpcBindAddr) startRPCServer(cfg.JrpcBindAddr, relayerManager) ch := make(chan os.Signal, 1) @@ -177,10 +176,10 @@ type RPCServer struct { //ServeHTTP ... func (r *RPCServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { - log.Info("ServeHTTP", "request address", req.RemoteAddr) + mainlog.Info("ServeHTTP", "request address", req.RemoteAddr) if !IsIPWhiteListEmpty() { if !IsInIPWhitelist(req.RemoteAddr) { - log.Info("ServeHTTP", "refuse connect address", req.RemoteAddr) + mainlog.Info("ServeHTTP", "refuse connect address", req.RemoteAddr) w.WriteHeader(401) return } @@ -224,7 +223,7 @@ func startRPCServer(address string, api interface{}) { w.WriteHeader(200) err := srv.ServeRequest(serverCodec) if err != nil { - log.Debug("http", "Error while serving JSON request: %v", err) + mainlog.Debug("http", "Error while serving JSON request: %v", err) return } } diff --git a/plugin/dapp/x2ethereum/ebrelayer/main.go b/plugin/dapp/x2ethereum/ebrelayer/main.go index 1413541e98..67556793c7 100644 --- a/plugin/dapp/x2ethereum/ebrelayer/main.go +++ b/plugin/dapp/x2ethereum/ebrelayer/main.go @@ -25,7 +25,6 @@ import ( relayerTypes "github.com/33cn/plugin/plugin/dapp/x2ethereum/ebrelayer/types" tml "github.com/BurntSushi/toml" "github.com/btcsuite/btcd/limits" - "github.com/prometheus/common/log" ) var ( @@ -54,19 +53,19 @@ func main() { if err != nil { panic(err) } - log.Info("current dir:", "dir", d) + mainlog.Info("current dir:", "dir", d) err = limits.SetLimits() if err != nil { panic(err) } cfg := initCfg(*configPath) - log.Info("Starting FUZAMEI Chain33-X-Ethereum relayer software:", "\n Name: ", cfg.Title) + mainlog.Info("Starting FUZAMEI Chain33-X-Ethereum relayer software:", "\n Name: ", cfg.Title) logf.SetFileLog(convertLogCfg(cfg.Log)) ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup - log.Info("db info:", " Dbdriver = ", cfg.SyncTxConfig.Dbdriver, ", DbPath = ", cfg.SyncTxConfig.DbPath, ", DbCache = ", cfg.SyncTxConfig.DbCache) - log.Info("deploy info:", "BridgeRegistry", cfg.BridgeRegistry) + mainlog.Info("db info:", " Dbdriver = ", cfg.SyncTxConfig.Dbdriver, ", DbPath = ", cfg.SyncTxConfig.DbPath, ", DbCache = ", cfg.SyncTxConfig.DbCache) + mainlog.Info("deploy info:", "BridgeRegistry", cfg.BridgeRegistry) mainlog.Info("db info:", " Dbdriver = ", cfg.SyncTxConfig.Dbdriver, ", DbPath = ", cfg.SyncTxConfig.DbPath, ", DbCache = ", cfg.SyncTxConfig.DbCache) db := dbm.NewDB("relayer_db_service", cfg.SyncTxConfig.Dbdriver, cfg.SyncTxConfig.DbPath, cfg.SyncTxConfig.DbCache) @@ -75,7 +74,7 @@ func main() { relayerManager := relayer.NewRelayerManager(chain33RelayerService, ethRelayerService, db) - log.Info("cfg.JrpcBindAddr = ", cfg.JrpcBindAddr) + mainlog.Info("cfg.JrpcBindAddr = ", cfg.JrpcBindAddr) startRPCServer(cfg.JrpcBindAddr, relayerManager) ch := make(chan os.Signal, 1) @@ -149,10 +148,10 @@ type RPCServer struct { //ServeHTTP ... func (r *RPCServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { - log.Info("ServeHTTP", "request address", req.RemoteAddr) + mainlog.Info("ServeHTTP", "request address", req.RemoteAddr) if !IsIPWhiteListEmpty() { if !IsInIPWhitelist(req.RemoteAddr) { - log.Info("ServeHTTP", "refuse connect address", req.RemoteAddr) + mainlog.Info("ServeHTTP", "refuse connect address", req.RemoteAddr) w.WriteHeader(401) return } @@ -196,7 +195,7 @@ func startRPCServer(address string, api interface{}) { w.WriteHeader(200) err := srv.ServeRequest(serverCodec) if err != nil { - log.Debug("http", "Error while serving JSON request: %v", err) + mainlog.Debug("http", "Error while serving JSON request: %v", err) return } }