[Win] Print log to stderr instead of debug.log.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 8 Jul 2013 03:09:53 +0000 (11:09 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 8 Jul 2013 03:09:53 +0000 (11:09 +0800)
app/atom_main_delegate.cc
app/atom_main_delegate.h

index 0867aa9..6e7d73d 100644 (file)
@@ -5,6 +5,7 @@
 #include "app/atom_main_delegate.h"
 
 #include "base/command_line.h"
+#include "base/logging.h"
 #include "browser/atom_browser_client.h"
 #include "content/public/common/content_switches.h"
 #include "renderer/atom_renderer_client.h"
@@ -17,6 +18,21 @@ AtomMainDelegate::AtomMainDelegate() {
 AtomMainDelegate::~AtomMainDelegate() {
 }
 
+bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
+  // Disable logging out to debug.log on Windows
+#if defined(OS_WIN)
+  logging::InitLogging(
+      L"debug.log",
+      logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
+      logging::LOCK_LOG_FILE,
+      logging::DELETE_OLD_LOG_FILE,
+      logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
+  logging::SetLogItems(true, false, true, false);
+#endif
+
+  return brightray::MainDelegate::BasicStartupComplete(exit_code);
+}
+
 void AtomMainDelegate::PreSandboxStartup() {
   brightray::MainDelegate::PreSandboxStartup();
 
index f8ee3d5..4a1f792 100644 (file)
@@ -15,6 +15,7 @@ class AtomMainDelegate : public brightray::MainDelegate {
   ~AtomMainDelegate();
 
  protected:
+  virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
   virtual void PreSandboxStartup() OVERRIDE;
 
  private: