diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index bcb14f4fd..dbf9058ba 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -72,8 +72,8 @@ }, { "ImportPath": "github.com/tendermint/log15", - "Comment": "v2.3-33-g105a1be", - "Rev": "105a1beefe3379227a0d61733a29fd2c34f7080c" + "Comment": "v2.3-34-gbec7415", + "Rev": "bec7415fb62f05ac62298c2bc1a080d45ac3065c" }, { "ImportPath": "golang.org/x/crypto/curve25519", diff --git a/Godeps/_workspace/src/github.com/tendermint/log15/format.go b/Godeps/_workspace/src/github.com/tendermint/log15/format.go index 6ea8c81b7..740433b3c 100644 --- a/Godeps/_workspace/src/github.com/tendermint/log15/format.go +++ b/Godeps/_workspace/src/github.com/tendermint/log15/format.go @@ -52,8 +52,10 @@ func TerminalFormat() Format { color = 31 case LvlWarn: color = 33 - case LvlInfo: + case LvlNotice: color = 32 + case LvlInfo: + color = 34 case LvlDebug: color = 36 } diff --git a/Godeps/_workspace/src/github.com/tendermint/log15/logger.go b/Godeps/_workspace/src/github.com/tendermint/log15/logger.go index dcd7cf8db..99b91876a 100644 --- a/Godeps/_workspace/src/github.com/tendermint/log15/logger.go +++ b/Godeps/_workspace/src/github.com/tendermint/log15/logger.go @@ -17,6 +17,7 @@ const ( LvlCrit Lvl = iota LvlError LvlWarn + LvlNotice LvlInfo LvlDebug ) @@ -28,6 +29,8 @@ func (l Lvl) String() string { return "dbug" case LvlInfo: return "info" + case LvlNotice: + return "notice" case LvlWarn: return "warn" case LvlError: @@ -47,6 +50,8 @@ func LvlFromString(lvlString string) (Lvl, error) { return LvlDebug, nil case "info": return LvlInfo, nil + case "notice": + return LvlNotice, nil case "warn": return LvlWarn, nil case "error", "eror": @@ -85,6 +90,7 @@ type Logger interface { // Log a message at the given level with context key/value pairs Debug(msg string, ctx ...interface{}) Info(msg string, ctx ...interface{}) + Notice(msg string, ctx ...interface{}) Warn(msg string, ctx ...interface{}) Error(msg string, ctx ...interface{}) Crit(msg string, ctx ...interface{}) @@ -133,6 +139,10 @@ func (l *logger) Info(msg string, ctx ...interface{}) { l.write(msg, LvlInfo, ctx) } +func (l *logger) Notice(msg string, ctx ...interface{}) { + l.write(msg, LvlNotice, ctx) +} + func (l *logger) Warn(msg string, ctx ...interface{}) { l.write(msg, LvlWarn, ctx) } diff --git a/Godeps/_workspace/src/github.com/tendermint/log15/root.go b/Godeps/_workspace/src/github.com/tendermint/log15/root.go index 85fd1f03f..fc3c23084 100644 --- a/Godeps/_workspace/src/github.com/tendermint/log15/root.go +++ b/Godeps/_workspace/src/github.com/tendermint/log15/root.go @@ -51,6 +51,11 @@ func Info(msg string, ctx ...interface{}) { root.write(msg, LvlInfo, ctx) } +// Notice is a convenient alias for Root().Notice +func Notice(msg string, ctx ...interface{}) { + root.write(msg, LvlNotice, ctx) +} + // Warn is a convenient alias for Root().Warn func Warn(msg string, ctx ...interface{}) { root.write(msg, LvlWarn, ctx) diff --git a/Godeps/_workspace/src/github.com/tendermint/log15/syslog.go b/Godeps/_workspace/src/github.com/tendermint/log15/syslog.go index 36c12b11f..4b16e2b27 100644 --- a/Godeps/_workspace/src/github.com/tendermint/log15/syslog.go +++ b/Godeps/_workspace/src/github.com/tendermint/log15/syslog.go @@ -34,6 +34,8 @@ func sharedSyslog(fmtr Format, sysWr *syslog.Writer, err error) (Handler, error) syslogFn = sysWr.Err case LvlWarn: syslogFn = sysWr.Warning + case LvlNotice: + syslogFn = sysWr.Notice case LvlInfo: syslogFn = sysWr.Info case LvlDebug: diff --git a/node/node.go b/node/node.go index 49ed65d30..f3f8aacdd 100644 --- a/node/node.go +++ b/node/node.go @@ -147,7 +147,6 @@ func NewNode() *Node { // Call Start() after adding the listeners. func (n *Node) Start() { - log.Info("Starting Node", "chainID", config.GetString("chain_id")) n.book.Start() n.sw.SetNodeInfo(makeNodeInfo(n.sw, n.privKey)) n.sw.SetNodePrivKey(n.privKey) @@ -291,6 +290,8 @@ func RunNode() { n.AddListener(l) n.Start() + log.Notice("Started node", "nodeInfo", n.sw.NodeInfo()) + // If seedNode is provided by config, dial out. if config.GetString("seeds") != "" { n.DialSeed() diff --git a/p2p/switch.go b/p2p/switch.go index 0ea29fab4..e642a27ba 100644 --- a/p2p/switch.go +++ b/p2p/switch.go @@ -338,7 +338,7 @@ func (sw *Switch) listenerRoutine(l Listener) { // ignore connection if we already have enough if maxNumPeers <= sw.peers.Size() { - log.Debug("Ignoring inbound connection: already have enough peers", "conn", inConn, "numPeers", sw.peers.Size(), "max", maxNumPeers) + log.Debug("Ignoring inbound connection: already have enough peers", "address", inConn.RemoteAddr().String(), "numPeers", sw.peers.Size(), "max", maxNumPeers) continue } @@ -351,7 +351,7 @@ func (sw *Switch) listenerRoutine(l Listener) { // New inbound connection! _, err := sw.AddPeerWithConnection(inConn, false) if err != nil { - log.Info("Ignoring inbound connection: error on AddPeerWithConnection", "conn", inConn, "error", err) + log.Info("Ignoring inbound connection: error on AddPeerWithConnection", "address", inConn.RemoteAddr().String(), "error", err) continue }