Use Host::File in lldb_private::StreamFile and other places to cleanup host
layer a bit more.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125149 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectLog.cpp b/source/Commands/CommandObjectLog.cpp
index cf090af..b887f1c 100644
--- a/source/Commands/CommandObjectLog.cpp
+++ b/source/Commands/CommandObjectLog.cpp
@@ -113,19 +113,16 @@
             std::string channel(args.GetArgumentAtIndex(0));
             args.Shift ();  // Shift off the channel
             StreamSP log_stream_sp;
-            StreamFile *log_file_ptr = NULL;  // This will get put in the log_stream_sp, no need to free it.
             if (m_options.log_file.empty())
             {
-                log_file_ptr = new StreamFile(m_interpreter.GetDebugger().GetOutputFileHandle());
-                log_stream_sp.reset(log_file_ptr);
+                log_stream_sp.reset(new StreamFile(m_interpreter.GetDebugger().GetOutputFile().GetDescriptor(), false));
             }
             else
             {
                 LogStreamMap::iterator pos = m_log_streams.find(m_options.log_file);
                 if (pos == m_log_streams.end())
                 {
-                    log_file_ptr = new StreamFile (m_options.log_file.c_str(), "w");
-                    log_stream_sp.reset (log_file_ptr);
+                    log_stream_sp.reset (new StreamFile (m_options.log_file.c_str()));
                     m_log_streams[m_options.log_file] = log_stream_sp;
                 }
                 else
@@ -133,10 +130,6 @@
             }
             assert (log_stream_sp.get());
             
-            // If we ended up making a StreamFile for log output, line buffer it.
-            if (log_file_ptr != NULL)
-                log_file_ptr->SetLineBuffered();
-                
             uint32_t log_options = m_options.log_options;
             if (log_options == 0)
                 log_options = LLDB_LOG_OPTION_PREPEND_THREAD_NAME | LLDB_LOG_OPTION_THREADSAFE;