mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-17 07:01:20 +00:00
update logger package for new level 'notice'
This commit is contained in:
4
Godeps/Godeps.json
generated
4
Godeps/Godeps.json
generated
@ -72,8 +72,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/tendermint/log15",
|
"ImportPath": "github.com/tendermint/log15",
|
||||||
"Comment": "v2.3-33-g105a1be",
|
"Comment": "v2.3-34-gbec7415",
|
||||||
"Rev": "105a1beefe3379227a0d61733a29fd2c34f7080c"
|
"Rev": "bec7415fb62f05ac62298c2bc1a080d45ac3065c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "golang.org/x/crypto/curve25519",
|
"ImportPath": "golang.org/x/crypto/curve25519",
|
||||||
|
4
Godeps/_workspace/src/github.com/tendermint/log15/format.go
generated
vendored
4
Godeps/_workspace/src/github.com/tendermint/log15/format.go
generated
vendored
@ -52,8 +52,10 @@ func TerminalFormat() Format {
|
|||||||
color = 31
|
color = 31
|
||||||
case LvlWarn:
|
case LvlWarn:
|
||||||
color = 33
|
color = 33
|
||||||
case LvlInfo:
|
case LvlNotice:
|
||||||
color = 32
|
color = 32
|
||||||
|
case LvlInfo:
|
||||||
|
color = 34
|
||||||
case LvlDebug:
|
case LvlDebug:
|
||||||
color = 36
|
color = 36
|
||||||
}
|
}
|
||||||
|
10
Godeps/_workspace/src/github.com/tendermint/log15/logger.go
generated
vendored
10
Godeps/_workspace/src/github.com/tendermint/log15/logger.go
generated
vendored
@ -17,6 +17,7 @@ const (
|
|||||||
LvlCrit Lvl = iota
|
LvlCrit Lvl = iota
|
||||||
LvlError
|
LvlError
|
||||||
LvlWarn
|
LvlWarn
|
||||||
|
LvlNotice
|
||||||
LvlInfo
|
LvlInfo
|
||||||
LvlDebug
|
LvlDebug
|
||||||
)
|
)
|
||||||
@ -28,6 +29,8 @@ func (l Lvl) String() string {
|
|||||||
return "dbug"
|
return "dbug"
|
||||||
case LvlInfo:
|
case LvlInfo:
|
||||||
return "info"
|
return "info"
|
||||||
|
case LvlNotice:
|
||||||
|
return "notice"
|
||||||
case LvlWarn:
|
case LvlWarn:
|
||||||
return "warn"
|
return "warn"
|
||||||
case LvlError:
|
case LvlError:
|
||||||
@ -47,6 +50,8 @@ func LvlFromString(lvlString string) (Lvl, error) {
|
|||||||
return LvlDebug, nil
|
return LvlDebug, nil
|
||||||
case "info":
|
case "info":
|
||||||
return LvlInfo, nil
|
return LvlInfo, nil
|
||||||
|
case "notice":
|
||||||
|
return LvlNotice, nil
|
||||||
case "warn":
|
case "warn":
|
||||||
return LvlWarn, nil
|
return LvlWarn, nil
|
||||||
case "error", "eror":
|
case "error", "eror":
|
||||||
@ -85,6 +90,7 @@ type Logger interface {
|
|||||||
// Log a message at the given level with context key/value pairs
|
// Log a message at the given level with context key/value pairs
|
||||||
Debug(msg string, ctx ...interface{})
|
Debug(msg string, ctx ...interface{})
|
||||||
Info(msg string, ctx ...interface{})
|
Info(msg string, ctx ...interface{})
|
||||||
|
Notice(msg string, ctx ...interface{})
|
||||||
Warn(msg string, ctx ...interface{})
|
Warn(msg string, ctx ...interface{})
|
||||||
Error(msg string, ctx ...interface{})
|
Error(msg string, ctx ...interface{})
|
||||||
Crit(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)
|
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{}) {
|
func (l *logger) Warn(msg string, ctx ...interface{}) {
|
||||||
l.write(msg, LvlWarn, ctx)
|
l.write(msg, LvlWarn, ctx)
|
||||||
}
|
}
|
||||||
|
5
Godeps/_workspace/src/github.com/tendermint/log15/root.go
generated
vendored
5
Godeps/_workspace/src/github.com/tendermint/log15/root.go
generated
vendored
@ -51,6 +51,11 @@ func Info(msg string, ctx ...interface{}) {
|
|||||||
root.write(msg, LvlInfo, ctx)
|
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
|
// Warn is a convenient alias for Root().Warn
|
||||||
func Warn(msg string, ctx ...interface{}) {
|
func Warn(msg string, ctx ...interface{}) {
|
||||||
root.write(msg, LvlWarn, ctx)
|
root.write(msg, LvlWarn, ctx)
|
||||||
|
2
Godeps/_workspace/src/github.com/tendermint/log15/syslog.go
generated
vendored
2
Godeps/_workspace/src/github.com/tendermint/log15/syslog.go
generated
vendored
@ -34,6 +34,8 @@ func sharedSyslog(fmtr Format, sysWr *syslog.Writer, err error) (Handler, error)
|
|||||||
syslogFn = sysWr.Err
|
syslogFn = sysWr.Err
|
||||||
case LvlWarn:
|
case LvlWarn:
|
||||||
syslogFn = sysWr.Warning
|
syslogFn = sysWr.Warning
|
||||||
|
case LvlNotice:
|
||||||
|
syslogFn = sysWr.Notice
|
||||||
case LvlInfo:
|
case LvlInfo:
|
||||||
syslogFn = sysWr.Info
|
syslogFn = sysWr.Info
|
||||||
case LvlDebug:
|
case LvlDebug:
|
||||||
|
@ -147,7 +147,6 @@ func NewNode() *Node {
|
|||||||
|
|
||||||
// Call Start() after adding the listeners.
|
// Call Start() after adding the listeners.
|
||||||
func (n *Node) Start() {
|
func (n *Node) Start() {
|
||||||
log.Info("Starting Node", "chainID", config.GetString("chain_id"))
|
|
||||||
n.book.Start()
|
n.book.Start()
|
||||||
n.sw.SetNodeInfo(makeNodeInfo(n.sw, n.privKey))
|
n.sw.SetNodeInfo(makeNodeInfo(n.sw, n.privKey))
|
||||||
n.sw.SetNodePrivKey(n.privKey)
|
n.sw.SetNodePrivKey(n.privKey)
|
||||||
@ -291,6 +290,8 @@ func RunNode() {
|
|||||||
n.AddListener(l)
|
n.AddListener(l)
|
||||||
n.Start()
|
n.Start()
|
||||||
|
|
||||||
|
log.Notice("Started node", "nodeInfo", n.sw.NodeInfo())
|
||||||
|
|
||||||
// If seedNode is provided by config, dial out.
|
// If seedNode is provided by config, dial out.
|
||||||
if config.GetString("seeds") != "" {
|
if config.GetString("seeds") != "" {
|
||||||
n.DialSeed()
|
n.DialSeed()
|
||||||
|
@ -338,7 +338,7 @@ func (sw *Switch) listenerRoutine(l Listener) {
|
|||||||
|
|
||||||
// ignore connection if we already have enough
|
// ignore connection if we already have enough
|
||||||
if maxNumPeers <= sw.peers.Size() {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ func (sw *Switch) listenerRoutine(l Listener) {
|
|||||||
// New inbound connection!
|
// New inbound connection!
|
||||||
_, err := sw.AddPeerWithConnection(inConn, false)
|
_, err := sw.AddPeerWithConnection(inConn, false)
|
||||||
if err != nil {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user