The way demonstrated in examples to put ASCII trace into a file:
AsciiTraceHelper ascii;
p2p.EnableAsciiAll (ascii.CreateFileStream ("tcp-star-server.tr"));
To output to stdout (or other existing std::ostream object), use the following instead:
pointToPoint.EnableAsciiAll (Create<OutputStreamWrapper>(&std::cout));