title: Capturing System/out in Clojure
body: <p>I'm working with a Java package that outputs text to the console and I need to capture that text in a string, but I'm not sure how to do this. From looking at the Clojure documentation it seemed that all I have to do is wrap the java call in <code>with-out-str</code> but that isn't working for me.</p>
  
  <p>Minimal code example: if I try</p>
  
  <pre><code>(with-out-str 
   (.println (System/out) "foo"))
  </code></pre>
  
  <p>I'm hoping to get a string with the value "foo", but it's still outputting to the console instead. What am I doing wrong?</p>