[Win] Write log to file in Debug build.
authorCheng Zhao <zcbenz@gmail.com>
Tue, 23 Jul 2013 08:37:00 +0000 (16:37 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 23 Jul 2013 08:37:00 +0000 (16:37 +0800)
app/atom_main_delegate.cc
atom.gyp

index 6e7d73d..9eb81ba 100644 (file)
@@ -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);
 }
index c2b1beb..747425f 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
        # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
       'filename_rules.gypi',
     ],
+    'configurations': {
+      'Debug': {
+        'defines': [
+          'DEBUG',
+        ],
+      },
+    },
   },
   'targets': [
     {