title: Android 5 - Redirect stdout to logcat
body: <p>I am trying to run some GMock/GTest tests on Android. These all run fine, but there's no output, as GMock logs to stdout.</p>
  
  <p>I've tried the following with no luck (likely because it's for the <a href="http://developer.android.com/tools/debugging/debugging-log.html#viewingStd" rel="nofollow">Dalvik VM</a>, and they've done away with that in Android 5):</p>
  
  <pre><code>$ adb shell stop
  $ adb shell setprop log.redirect-stdio true
  $ adb shell start
  </code></pre>
  
  <p>When <code>log.redirect-stdio</code> is set to true, there is still no output from stdio to logcat.</p>
  
  <p>I've also tried custom several <code>streambuf</code> implementations with <code>std::cout.rdbuf</code> to try to direct stdout to logcat with <code>__android_log_print</code>, but none of these have printed anything to logcat.</p>
  
  <p>Has anyone successfully managed to redirect stdout to logcat in Android 5?</p>
  
  <p>I can add more details (such as <code>streambuf</code> implementations I've tried) if needed.</p>