From 7d61dcdde11161afeb3909fd75faa23848ebd1c4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 23 Jul 2013 16:37:00 +0800 Subject: [PATCH] [Win] Write log to file in Debug build. --- app/atom_main_delegate.cc | 6 +++++- atom.gyp | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/atom_main_delegate.cc b/app/atom_main_delegate.cc index 6e7d73d2ba..9eb81ba1d5 100644 --- a/app/atom_main_delegate.cc +++ b/app/atom_main_delegate.cc @@ -23,12 +23,16 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { #if defined(OS_WIN) logging::InitLogging( L"debug.log", +#if defined(DEBUG) + logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG , +#else logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, +#endif // defined(NDEBUG) logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE, logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); logging::SetLogItems(true, false, true, false); -#endif +#endif // defined(OS_WIN) return brightray::MainDelegate::BasicStartupComplete(exit_code); } diff --git a/atom.gyp b/atom.gyp index c2b1bebb70..747425f1f1 100644 --- a/atom.gyp +++ b/atom.gyp @@ -181,6 +181,13 @@ # Rules for excluding e.g. foo_win.cc from the build on non-Windows. 'filename_rules.gypi', ], + 'configurations': { + 'Debug': { + 'defines': [ + 'DEBUG', + ], + }, + }, }, 'targets': [ {