Use specified ostream rather than cout.