title: How to see Bazel build output?
body: <p>How do you view stdout of bazel build as it happens?</p>
  
  <p>I want to see all the logs written to stdout during a bazel build.</p>
  
  <p>No one of these allows it to show the ls command before after it has failed</p>
  
  <pre><code>$ bazel build --show_progress --worker_verbose --verbose_failures --verbose_explanations=true -s --test_output=streamed :build
  </code></pre>
  
  <pre><code>genrule(
    name = "build",
    cmd = "ls &amp;&amp; sleep 60 &amp;&amp; exit 1",
  )
  
  </code></pre>
  
  <pre><code>$ bazel build --show_progress --worker_verbose --verbose_failures --verbose_explanations=true -s --test_output=streamed :build
  WARNING: --verbose_explanations has no effect when --explain=&lt;file&gt; is not enabled
  INFO: Analyzed target //:build (0 packages loaded, 0 targets configured).
  INFO: Found 1 target...
  SUBCOMMAND: # //:build [action 'Executing genrule //:build']
  (cd /private/var/tmp/_bazel_kevinsimper/f9e6a72c146c5ad83b84a8ebf539f8b2/execroot/__main__ &amp;&amp; \
    exec env - \
      PATH=/usr/local/sbin \
    /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; ls &amp;&amp; sleep 60 &amp;&amp; exit 1')
  ERROR: /Users/kevinsimper/testproject/BUILD:1:1: Executing genrule //:build failed (Exit 1)
  BUILD
  TESTFILE
  Target //:build failed to build
  INFO: Elapsed time: 60.256s, Critical Path: 60.04s
  INFO: 0 processes.
  FAILED: Build did NOT complete successfully
  </code></pre>