title: Send messages to file not as expected
body: <p>Trying to use <code>message</code> for some simple logging in RStudio. I would love to have the possibility of messages ending up in a temp file.</p>
  
  <p>After reading this <a href="https://stackoverflow.com/questions/24767751/how-can-you-always-suppress-messages-in-r">How can you always suppress messages in R?</a> I thought I knew how to proceed.</p>
  
  <pre><code>message("this is red text on screen")
  
  zz &lt;- file("messages.Rout", open = "wt")
  sink(file=zz, type = "message")
  
  message("This I hope only goes to the file")
  
  sink(type="message") #Reset so that messages come out to screen as normal
  </code></pre>
  
  <p>Problem is that the text <code>This I hope only goes to the file</code> still shows up in the console within RStudio when Current Chunk is Run.</p>
  
  <p>Am I misunderstanding something?</p>
  
  <p>Big thanks in advance, I've been using R for a while but often come back with newbie questions....</p>