Browse Source

errfile, logfile support added

nareshv 11 years ago
parent
commit
b71dd2a6e3
4 changed files with 10 additions and 12 deletions
  1. 2 3
      hhvm/deploy/config-debug.hdf
  2. 1 5
      hhvm/deploy/config.hdf
  3. 3 0
      hhvm/run-debug.sh
  4. 4 4
      hhvm/setup.py

+ 2 - 3
hhvm/deploy/config-debug.hdf

@@ -10,11 +10,10 @@ Server {
   DefaultDocument = index.php
 }
 
-# Disable logging completely
+# Enable debug logging
 Log {
-  Level = Verbose
-  UseLogFile = false
   UseSyslog = false
+  Level = Verbose
 }
 
 # Enable jit for production mode

+ 1 - 5
hhvm/deploy/config.hdf

@@ -12,12 +12,8 @@ Server {
 
 # Disable logging completely
 Log {
-  Level = None
-  NoSilencer = true
-  AlwaysLogUnhandledExceptions = false
-  RuntimeErrorReportingLevel = 8191
-  UseLogFile = false
   UseSyslog = false
+  Level = Error
 }
 
 # Enable jit for production mode

+ 3 - 0
hhvm/run-debug.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+hhvm --config ./deploy/config-debug.hdf -m server

+ 4 - 4
hhvm/setup.py

@@ -6,7 +6,7 @@ from os.path import expanduser
 
 home = expanduser("~")
 
-def start(args):
+def start(args, logfile, errfile):
   setup_util.replace_text("hhvm/once.php.inc", "host=.*;", "host=" + args.database_host + ";")
   setup_util.replace_text("hhvm/deploy/config.hdf", "SourceRoot = .*\/FrameworkBenchmarks", "SourceRoot = " + home + "/FrameworkBenchmarks")
   setup_util.replace_text("hhvm/deploy/config.hdf", "Path = .*\/.hhvm.hhbc", "Path = " + home + "/FrameworkBenchmarks/hhvm/.hhvm.bbhc")
@@ -16,16 +16,16 @@ def start(args):
     if os.name == 'nt':
       # Not supported !
       return 0
-    subprocess.check_call("sudo hhvm --config " + home + "/FrameworkBenchmarks/hhvm/deploy/config.hdf -m daemon", shell=True)
+    subprocess.check_call("sudo hhvm --config " + home + "/FrameworkBenchmarks/hhvm/deploy/config.hdf -m daemon", shell=True, stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1
-def stop():
+def stop(logfile, errfile):
   try:
     if os.name == 'nt':
       # Not Supported !
       return 0
-    subprocess.call("sudo kill -QUIT $( cat hhvm/hhvm.pid )", shell=True)
+    subprocess.call("sudo kill -QUIT $( cat hhvm/hhvm.pid )", shell=True, stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1