How do you print an istream variable to standard out. [EDIT] I am trying to debug a scenario wherein I need to ouput an istream to a log file
You ouput the istream's streambuf.
For example, to output an ifstream to cout:
std::ifstream f("whatever"); std::cout << f.rdbuf();