Updated logging

This commit is contained in:
obscuren
2015-04-07 14:57:04 +02:00
parent 01b2c90179
commit 688d118c7e
13 changed files with 76 additions and 58 deletions

View File

@ -33,10 +33,10 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/rlp"
)
var clilogger = logger.NewLogger("CLI")
var interruptCallbacks = []func(os.Signal){}
// Register interrupt handlers callbacks
@ -50,7 +50,7 @@ func HandleInterrupt() {
go func() {
signal.Notify(c, os.Interrupt)
for sig := range c {
clilogger.Errorf("Shutting down (%v) ... \n", sig)
glog.V(logger.Error).Infof("Shutting down (%v) ... \n", sig)
RunInterruptCallbacks(sig)
}
}()
@ -113,7 +113,7 @@ func Fatalf(format string, args ...interface{}) {
}
func StartEthereum(ethereum *eth.Ethereum) {
clilogger.Infoln("Starting ", ethereum.Name())
glog.V(logger.Info).Infoln("Starting ", ethereum.Name())
if err := ethereum.Start(); err != nil {
exit(err)
}
@ -124,7 +124,7 @@ func StartEthereum(ethereum *eth.Ethereum) {
}
func StartEthereumForTest(ethereum *eth.Ethereum) {
clilogger.Infoln("Starting ", ethereum.Name())
glog.V(logger.Info).Infoln("Starting ", ethereum.Name())
ethereum.StartForTest()
RegisterInterrupt(func(sig os.Signal) {
ethereum.Stop()