Exemple #1
0
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)
		}
	}
}
Exemple #2
0
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})")
	}
}