Commit d46f496c authored by Vincent Pelletier's avatar Vincent Pelletier

Output formated timestamp in front of each message.

parent 2dfa0a97
......@@ -9,7 +9,7 @@ import socket
import pprint
import traceback
from SlapOSControler import SlapOSControler
import time
class SubprocessError(EnvironmentError):
def __init__(self, status_dict):
......@@ -22,6 +22,10 @@ class SubprocessError(EnvironmentError):
from Updater import Updater
def log(message):
# Log to stdout, with a timestamp.
print time.strftime('%Y/%m/%d %H:%M:%S'), message
process_group_pid_set = set()
process_pid_file_list = []
process_command_list = []
......@@ -51,8 +55,10 @@ def safeRpcCall(function, *args):
try:
return function(*args)
except:
traceback.print_exc()
pprint.pprint(args)
log('Error in RPC call: %s\n%s' % (
traceback.format_exc(),
pprint.pformat(args),
))
time.sleep(retry)
retry += retry >> 1
......@@ -175,7 +181,7 @@ branch = %(branch)s
retry_software = False
previous_revision = revision
print config
log(config)
portal_url = config['test_suite_master_url']
test_result_path = None
test_result = (test_result_path, revision)
......@@ -191,7 +197,7 @@ branch = %(branch)s
config['test_suite'], revision, [],
False, test_suite_title,
config['test_node_title'], config['project_title'])
print "testnode, test_result : %r" % (test_result,)
log("testnode, test_result : %r" % (test_result, ))
if test_result:
test_result_path, test_revision = test_result
if revision != test_revision:
......@@ -258,5 +264,5 @@ branch = %(branch)s
# Nice way to kill *everything* generated by run process -- process
# groups working only in POSIX compilant systems
# Exceptions are swallowed during cleanup phase
print "going to kill %r" % (process_group_pid_set,)
log("going to kill %r" % (process_group_pid_set, ))
killPreviousRun(process_group_pid_set, supervisord_pid_file)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment