title: How to get warnings() output to string
body: <p>When I type warnings() to console, I get back</p>
  
  <pre><code>Warning message:
  In fread(my_directory,  ... :
   C function strtod() returned ERANGE for one or more fields. The first was string input    '4.40589099726375E-309'. It was read using (double)strtold() as numeric
  </code></pre>
  
  <p>However when I type <code>as.character(warnings())</code>, I get:</p>
  
  <pre><code>[1] "fread(my_directory)"
  </code></pre>
  
  <p>My objective is to get the <em>actual</em> message displayed in warning() into a character string, so that I can pass it to the <code>logwarn</code> function in the <code>logging</code> package. Currently, I am doing <code>logwarn(warnings(),logger="some_log_file.log")</code> to record my warnings, but it gives the incorrect coercion to <code>character</code> that I displayed above.</p>
  
  <p>Note that I can just use <code>sink</code> but I want to stick with <code>logging</code> package, so I require the ability to correct coerce to <code>character</code>.</p>