move the prefix printing into output itself.

small bug right now: Split calls to output() without a newline get
two prefixes logged. Will fix later.