Use the logging module consistently to output messages.

When cbuildbot outputs informational messages, these messages should be
sent to the same place consistently. We've arbitrarily decided to send
the logging output to stderr, so I've output all places that output
informational messages to send them via the logging module.

Some places in cbuildbot that don't use the logging module:
  - builderstage.py, because it prints formatted strings, which would
    look ugly with the current formatting. This spot could probably be
    updated to use the logging module as well if we updated the
    formatting.
  - cbuildbot_background, because it's forwarding output from another
    process and can be used in programs other than cbuildbot. In this
    case I added a flush of stdout and stderr prior to starting output
    to prevent interleaving.

BUG=chromium-os:32648
TEST=Several remote trybot runs. All unit tests. Pylint on all changed files.

Change-Id: Ib03075e239cab8572ac6b5b4808fd0150d29ec71
Reviewed-on: https://gerrit.chromium.org/gerrit/27791
Commit-Ready: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/scripts/upload_prebuilts_unittest.py b/scripts/upload_prebuilts_unittest.py
index 921a3b0..9b8a4ce 100755
--- a/scripts/upload_prebuilts_unittest.py
+++ b/scripts/upload_prebuilts_unittest.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
@@ -493,4 +493,5 @@
     prebuilt.main([])
 
 if __name__ == '__main__':
+  cros_build_lib.SetupBasicLogging()
   unittest.main()