mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
Service log prettify
This commit is contained in:
parent
1d362a71ed
commit
c0a64d74be
4
Godeps/_workspace/src/github.com/tendermint/log15/logger.go
generated
vendored
4
Godeps/_workspace/src/github.com/tendermint/log15/logger.go
generated
vendored
@ -30,7 +30,7 @@ func (l Lvl) String() string {
|
||||
case LvlInfo:
|
||||
return "info"
|
||||
case LvlNotice:
|
||||
return "notice"
|
||||
return "note"
|
||||
case LvlWarn:
|
||||
return "warn"
|
||||
case LvlError:
|
||||
@ -50,7 +50,7 @@ func LvlFromString(lvlString string) (Lvl, error) {
|
||||
return LvlDebug, nil
|
||||
case "info":
|
||||
return LvlInfo, nil
|
||||
case "notice":
|
||||
case "note":
|
||||
return LvlNotice, nil
|
||||
case "warn":
|
||||
return LvlWarn, nil
|
||||
|
@ -49,6 +49,8 @@ type Service interface {
|
||||
AfterStop()
|
||||
|
||||
IsRunning() bool
|
||||
|
||||
String() string
|
||||
}
|
||||
|
||||
type BaseService struct {
|
||||
@ -117,6 +119,11 @@ func (bs *BaseService) IsRunning() bool {
|
||||
return atomic.LoadUint32(&bs.started) == 1 && atomic.LoadUint32(&bs.stopped) == 0
|
||||
}
|
||||
|
||||
// Implements Servce
|
||||
func (bs *BaseService) String() string {
|
||||
return bs.name
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
type QuitService struct {
|
||||
|
@ -1227,3 +1227,7 @@ func (cs *ConsensusState) saveBlock(block *types.Block, blockParts *types.PartSe
|
||||
func (cs *ConsensusState) SetFireable(evsw events.Fireable) {
|
||||
cs.evsw = evsw
|
||||
}
|
||||
|
||||
func (cs *ConsensusState) String() string {
|
||||
return Fmt("ConsensusState(H:%v R:%v S:%v", cs.Height, cs.Round, cs.Step)
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ func makeSwitchPair(t testing.TB, initSwitch func(*Switch) *Switch) (*Switch, *S
|
||||
})
|
||||
s2.SetNodePrivKey(s2PrivKey)
|
||||
|
||||
// Start switches
|
||||
// Start switches and reactors
|
||||
s1.Start()
|
||||
s2.Start()
|
||||
|
||||
@ -130,11 +130,11 @@ func TestSwitches(t *testing.T) {
|
||||
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{
|
||||
&ChannelDescriptor{Id: byte(0x00), Priority: 10},
|
||||
&ChannelDescriptor{Id: byte(0x01), Priority: 10},
|
||||
}, true)).Start() // Start the reactor
|
||||
}, true))
|
||||
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{
|
||||
&ChannelDescriptor{Id: byte(0x02), Priority: 10},
|
||||
&ChannelDescriptor{Id: byte(0x03), Priority: 10},
|
||||
}, true)).Start() // Start the reactor
|
||||
}, true))
|
||||
return sw
|
||||
})
|
||||
defer s1.Stop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user