From 2282c53485c44331653c515b560133de1a97507e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 8 Jul 2013 11:09:53 +0800 Subject: [PATCH] [Win] Print log to stderr instead of debug.log. --- app/atom_main_delegate.cc | 16 ++++++++++++++++ app/atom_main_delegate.h | 1 + 2 files changed, 17 insertions(+) diff --git a/app/atom_main_delegate.cc b/app/atom_main_delegate.cc index 0867aa9b95da..6e7d73d2ba37 100644 --- a/app/atom_main_delegate.cc +++ b/app/atom_main_delegate.cc @@ -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(); diff --git a/app/atom_main_delegate.h b/app/atom_main_delegate.h index f8ee3d52e847..4a1f7921da68 100644 --- a/app/atom_main_delegate.h +++ b/app/atom_main_delegate.h @@ -15,6 +15,7 @@ class AtomMainDelegate : public brightray::MainDelegate { ~AtomMainDelegate(); protected: + virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; virtual void PreSandboxStartup() OVERRIDE; private: