aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-02 22:15:28 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-02 22:15:28 +0800
commit0976c3024f271e89d1d4de32dfb518c02e691643 (patch)
tree37dba0ec8cc9b95f98be8b36ac30dbd2a2f2389a /eth/backend.go
parent60a2704b049a2bc8de417c8f50155ec69b071a9e (diff)
downloadgo-tangerine-0976c3024f271e89d1d4de32dfb518c02e691643.tar.gz
go-tangerine-0976c3024f271e89d1d4de32dfb518c02e691643.tar.zst
go-tangerine-0976c3024f271e89d1d4de32dfb518c02e691643.zip
Don't import logger as ethlogger
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/eth/backend.go b/eth/backend.go
index f67f9c78b..8d5da01fd 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -12,7 +12,7 @@ import (
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
- ethlogger "github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
@@ -23,8 +23,8 @@ import (
)
var (
- logger = ethlogger.NewLogger("SERV")
- jsonlogger = ethlogger.NewJsonLogger()
+ ethlogger = logger.NewLogger("SERV")
+ jsonlogger = logger.NewJsonLogger()
defaultBootNodes = []*discover.Node{
// ETH/DEV cmd/bootnode
@@ -74,7 +74,7 @@ func (cfg *Config) parseBootNodes() []*discover.Node {
}
n, err := discover.ParseNode(url)
if err != nil {
- logger.Errorf("Bootstrap URL %s: %v\n", url, err)
+ ethlogger.Errorf("Bootstrap URL %s: %v\n", url, err)
continue
}
ns = append(ns, n)
@@ -98,7 +98,7 @@ func (cfg *Config) nodeKey() (*ecdsa.PrivateKey, error) {
return nil, fmt.Errorf("could not generate server key: %v", err)
}
if err := ioutil.WriteFile(keyfile, crypto.FromECDSA(key), 0600); err != nil {
- logger.Errorln("could not persist nodekey: ", err)
+ ethlogger.Errorln("could not persist nodekey: ", err)
}
return key, nil
}
@@ -130,14 +130,14 @@ type Ethereum struct {
WsServer rpc.RpcServer
keyManager *crypto.KeyManager
- logger ethlogger.LogSystem
+ logger logger.LogSystem
Mining bool
}
func New(config *Config) (*Ethereum, error) {
// Boostrap database
- logger := ethlogger.New(config.DataDir, config.LogFile, config.LogLevel, config.LogFormat)
+ ethlogger := logger.New(config.DataDir, config.LogFile, config.LogLevel, config.LogFormat)
db, err := ethdb.NewLDBDatabase("blockchain")
if err != nil {
return nil, err
@@ -174,7 +174,7 @@ func New(config *Config) (*Ethereum, error) {
keyManager: keyManager,
blacklist: p2p.NewBlacklist(),
eventMux: &event.TypeMux{},
- logger: logger,
+ logger: ethlogger,
}
eth.chainManager = core.NewChainManager(db, eth.EventMux())
@@ -216,7 +216,7 @@ func New(config *Config) (*Ethereum, error) {
}
func (s *Ethereum) KeyManager() *crypto.KeyManager { return s.keyManager }
-func (s *Ethereum) Logger() ethlogger.LogSystem { return s.logger }
+func (s *Ethereum) Logger() logger.LogSystem { return s.logger }
func (s *Ethereum) Name() string { return s.net.Name }
func (s *Ethereum) ChainManager() *core.ChainManager { return s.chainManager }
func (s *Ethereum) BlockProcessor() *core.BlockProcessor { return s.blockProcessor }
@@ -234,7 +234,7 @@ func (s *Ethereum) Coinbase() []byte { return nil } // TODO
// Start the ethereum
func (s *Ethereum) Start() error {
- jsonlogger.LogJson(&ethlogger.LogStarting{
+ jsonlogger.LogJson(&logger.LogStarting{
ClientString: s.net.Name,
ProtocolVersion: ProtocolVersion,
})
@@ -260,7 +260,7 @@ func (s *Ethereum) Start() error {
s.blockSub = s.eventMux.Subscribe(core.NewMinedBlockEvent{})
go s.blockBroadcastLoop()
- logger.Infoln("Server started")
+ ethlogger.Infoln("Server started")
return nil
}
@@ -295,7 +295,7 @@ func (s *Ethereum) Stop() {
s.whisper.Stop()
}
- logger.Infoln("Server stopped")
+ ethlogger.Infoln("Server stopped")
close(s.shutdownChan)
}