Service log prettify

This commit is contained in:
Jae Kwon
2015-07-20 16:55:05 -07:00
parent 1d362a71ed
commit c0a64d74be
4 changed files with 16 additions and 5 deletions

View File

@ -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 {