title: Scala process logger
body: <p>I am following the <a href="http://alvinalexander.com/scala/how-to-handle-stdout-stderr-external-system-commands-scala" rel="nofollow noreferrer">example</a> for Scala Process Logger by Alvin Alexander which talks about how to handle stdout and stderr from external system commands. I get most part of the example and now understands how to use it but I am finding hard to understand the purpose of <code>append _</code>. Can someone please help me in understanding it? The documents is pretty vague for it.</p>
  
  <pre><code>#!/bin/sh
  exec scala "$0" "$@"
  !#
  import sys.process._
  
  val stdout = new StringBuilder
  val stderr = new StringBuilder
  val status = "ls -al FRED" ! ProcessLogger(stdout append _, stderr append _)
  
  println(status)
  println("stdout: " + stdout)
  println("stderr: " + stderr)
  </code></pre>