Add ELECTRON_ENABLE_LOGGING env
authorCheng Zhao <zcbenz@gmail.com>
Tue, 20 Oct 2015 05:00:28 +0000 (13:00 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 20 Oct 2015 05:00:28 +0000 (13:00 +0800)
It is the same with --enable-logging.

atom/app/atom_main_delegate.cc

index 44f2048c091fff09efe63cd277a5cae7e02fe186..392e4dcb36012cc40e4f6873f277753b657743f5 100644 (file)
@@ -59,7 +59,9 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
 #endif  // !defined(OS_WIN)
 
   // Only enable logging when --enable-logging is specified.
-  if (!command_line->HasSwitch(switches::kEnableLogging)) {
+  scoped_ptr<base::Environment> env(base::Environment::Create());
+  if (!command_line->HasSwitch(switches::kEnableLogging) &&
+      !env->HasVar("ELECTRON_ENABLE_LOGGING")) {
     settings.logging_dest = logging::LOG_NONE;
     logging::SetMinLogLevel(logging::LOG_NUM_SEVERITIES);
   }