diff --git a/tools/walletextension/common/common.go b/tools/walletextension/common/common.go index a9a099b362..94ac8be729 100644 --- a/tools/walletextension/common/common.go +++ b/tools/walletextension/common/common.go @@ -3,9 +3,6 @@ package common import ( "encoding/json" "fmt" - "os" - - gethforklog "github.com/ten-protocol/go-ten/lib/gethfork/log" gethrpc "github.com/ten-protocol/go-ten/lib/gethfork/rpc" @@ -79,13 +76,3 @@ func (r *RPCRequest) Clone() *RPCRequest { Params: r.Params, } } - -// NewFileLogger is a logger factory function -func NewFileLogger() gethlog.Logger { - // Open or create your log file - file, err := os.OpenFile("gateway_logs.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o644) - if err != nil { - panic(err) - } - return gethlog.NewLogger(gethlog.NewGlogHandler(gethforklog.NewTerminalHandler(file, false))) -} diff --git a/tools/walletextension/rpcapi/utils.go b/tools/walletextension/rpcapi/utils.go index a90eacb810..732fd45d2e 100644 --- a/tools/walletextension/rpcapi/utils.go +++ b/tools/walletextension/rpcapi/utils.go @@ -265,7 +265,7 @@ func withCache[R any](cache cache.Cache, cfg *CacheCfg, cacheKey []byte, onCache func audit(services *Services, msg string, params ...any) { if services.Config.VerboseFlag { - services.FileLogger.Info(fmt.Sprintf(msg, params...)) + services.logger.Info(fmt.Sprintf(msg, params...)) } } diff --git a/tools/walletextension/rpcapi/wallet_extension.go b/tools/walletextension/rpcapi/wallet_extension.go index fae47871f7..ddd9e1cf54 100644 --- a/tools/walletextension/rpcapi/wallet_extension.go +++ b/tools/walletextension/rpcapi/wallet_extension.go @@ -41,7 +41,6 @@ type Services struct { HostAddrWS string // The WS address on which the Ten host can be reached Storage storage.Storage logger gethlog.Logger - FileLogger gethlog.Logger stopControl *stopcontrol.StopControl version string Cache cache.Cache @@ -58,7 +57,6 @@ type NewHeadNotifier interface { } func NewServices(hostAddrHTTP string, hostAddrWS string, storage storage.Storage, stopControl *stopcontrol.StopControl, version string, logger gethlog.Logger, config *common.Config) *Services { - newFileLogger := common.NewFileLogger() newGatewayCache, err := cache.NewCache(logger) if err != nil { logger.Error(fmt.Errorf("could not create cache. Cause: %w", err).Error()) @@ -101,7 +99,6 @@ func NewServices(hostAddrHTTP string, hostAddrWS string, storage storage.Storage HostAddrWS: hostAddrWS, Storage: storage, logger: logger, - FileLogger: newFileLogger, stopControl: stopControl, version: version, Cache: newGatewayCache,