Update stdout to logging redirect context manager to redirect based on lines and not write operations

I think there might even be some buffered stream class one could use for this to get this to happen automatically.