예제 #1
0
파일: tty.go 프로젝트: burke/zeus
func (s *StatusChart) drawSubtree(node *processtree.SlaveNode, myIndentation, childIndentation string) {
	printStateInfo(myIndentation, node.Name, node.State(), false, true)

	for i, slave := range node.Slaves {
		if i == len(node.Slaves)-1 {
			s.drawSubtree(slave, childIndentation+lineL, childIndentation+lineX)
		} else {
			s.drawSubtree(slave, childIndentation+lineT, childIndentation+lineI)
		}
	}
}
예제 #2
0
파일: stdout.go 프로젝트: burke/zeus
func (s *StatusChart) logSubtree(node *processtree.SlaveNode) {
	log := theChart.directLogger
	printStateInfo("", node.Name, node.State(), true, false)

	if len(node.Slaves) > 0 {
		log.ColorizedSansNl("{reset}(")
	}
	for i, slave := range node.Slaves {
		if i != 0 {
			log.ColorizedSansNl("{reset}, ")
		}
		s.logSubtree(slave)
	}
	if len(node.Slaves) > 0 {
		log.ColorizedSansNl("{reset})")
	}
}