cleaned up the output from the stm32 downloader code
diff --git a/aos/build/download_externals.sh b/aos/build/download_externals.sh
index f33eced..ee3cd2d 100755
--- a/aos/build/download_externals.sh
+++ b/aos/build/download_externals.sh
@@ -6,11 +6,13 @@
 . $(dirname $0)/tools_config
 COMPILED=${EXTERNALS}/../compiled-arm
 
-export CC=arm-linux-gnueabihf-gcc-4.7
-export CXX=arm-linux-gnueabihf-g++-4.7
-export CFLAGS=-mcpu="cortex-a8 -mfpu=neon"
-export CXXFLAGS=-mcpu="cortex-a8 -mfpu=neon"
-export OBJDUMP=arm-linux-gnueabihf-objdump
+CROSS_COMPILE=arm-linux-gnueabihf-
+
+export CC=${CROSS_COMPLIE}gcc-4.7
+export CXX=${CROSS_COMPLIE}g++-4.7
+export CFLAGS="-mcpu=cortex-a8 -mfpu=neon"
+export CXXFLAGS="-mcpu=cortex-a8 -mfpu=neon"
+export OBJDUMP=${CROSS_COMPLIE}objdump
 # Flags that should get passed to all configure scripts.
 # Some of them need to set LDFLAGS separately to work around stupid configure
 # scripts, so we can't just set that here.
diff --git a/aos/common/logging/logging_impl.cc b/aos/common/logging/logging_impl.cc
index a76c28a..980f65a 100644
--- a/aos/common/logging/logging_impl.cc
+++ b/aos/common/logging/logging_impl.cc
@@ -120,6 +120,16 @@
 
 }  // namespace internal
 
+StreamLogImplementation::StreamLogImplementation(FILE *stream)
+    : stream_(stream) {}
+
+void StreamLogImplementation::DoLog(log_level level, const char *format,
+                                    va_list ap) {
+  LogMessage message;
+  internal::FillInMessage(level, format, ap, &message);
+  internal::PrintMessage(stream_, message);
+}
+
 void LogImplementation::DoVLog(log_level level, const char *format, va_list ap,
                    int levels) {
   Context *context = Context::Get();
diff --git a/aos/common/logging/logging_impl.h b/aos/common/logging/logging_impl.h
index 1416fe1..18f35bc 100644
--- a/aos/common/logging/logging_impl.h
+++ b/aos/common/logging/logging_impl.h
@@ -114,6 +114,17 @@
   LogImplementation *next_;
 };
 
+// A log implementation that dumps all messages to a C stdio stream.
+class StreamLogImplementation : public LogImplementation {
+ public:
+  StreamLogImplementation(FILE *stream);
+
+ private:
+  virtual void DoLog(log_level level, const char *format, va_list ap);
+
+  FILE *const stream_;
+};
+
 // Adds another implementation to the stack of implementations in this
 // task/thread.
 // Any tasks/threads created after this call will also use this implementation.