This includes several changes to status and console logging:
- SSHHost now turns on console and netconsole logging by default
- autotest writes status logs to status.log instead of just echoing them to stdout
- logging is now unbuffered so that services monitoring the log files see new logs as they come in 

From: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@829 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/hosts/ssh_host.py b/server/hosts/ssh_host.py
index 1a0b1b8..04dd960 100644
--- a/server/hosts/ssh_host.py
+++ b/server/hosts/ssh_host.py
@@ -47,8 +47,8 @@
 	SSH_BASE_COMMAND = 'ssh -a'
 
 	def __init__(self, hostname, user="root", port=22, initialize=True,
-		     conmux_log=None, conmux_server=None, conmux_attach=None,
-		     netconsole_log=None, netconsole_port=6666):
+		     conmux_log="console.log", conmux_server=None, conmux_attach=None,
+		     netconsole_log="netconsole.log", netconsole_port=6666):
 		"""
 		Construct a SSHHost object
 		
@@ -148,7 +148,7 @@
 		if logfilename == None:
 			return
 		cmd = ['nc', '-u', '-l', '-p', str(port)]
-		logger = subprocess.Popen(cmd, stdout=open(logfilename, "w"))
+		logger = subprocess.Popen(cmd, stdout=open(logfilename, "a", 0))
 		self.netlogger_pid = logger.pid
 
 
@@ -204,8 +204,9 @@
 			to = '%s/%s' % (self.conmux_server, self.hostname)
 		else:
 			to = self.hostname
-		cmd = [self.conmux_attach, to, 'cat - > %s' % logfilename]
+		cmd = [self.conmux_attach, to, 'cat -']
 		logger = subprocess.Popen(cmd,
+					  stdout=open(logfilename, 'a', 0),
 					  stderr=open('/dev/null', 'w'),
 					  preexec_fn=lambda: os.setpgid(0, 0))
 		self.logger_pid = logger.pid