logging the tree