Commit 2dc227f8 authored by Vincent Pelletier's avatar Vincent Pelletier

Redirect logs of applications running in test process to their own logfile.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1532 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 46a40237
......@@ -28,9 +28,19 @@ import traceback
from neo.neoctl.neoctl import NeoCTL, NotReadyException
from neo.protocol import ClusterStates, NodeTypes, CellStates
from neo.client.Storage import Storage
from neo.util import dump
import neo
# Replace neo.setupLog by a no-op function.
# This will only impact instances created in this process, so client only.
def dummy_setupLog(*args, **kw):
pass
real_setupLog = neo.setupLog
neo.setupLog = dummy_setupLog
# Import Storage only *after* patching neo.setupLog, as it keeps a direct
# reference to setupLog.
from neo.client.Storage import Storage
NEO_MASTER = 'neomaster'
NEO_STORAGE = 'neostorage'
NEO_ADMIN = 'neoadmin'
......@@ -144,6 +154,9 @@ class NEOCluster(object):
temp_dir = tempfile.mkdtemp(prefix='neo_')
print 'Using temp directory %r.' % (temp_dir, )
self.temp_dir = temp_dir
# Setup client logger
real_setupLog(name='CLIENT', filename=os.path.join(self.temp_dir,
'client.log'), verbose=True)
admin_port = self.__allocatePort()
self.cluster_name = 'neo_%s' % (random.randint(0, 100), )
master_node_list = [self.__allocatePort() for i in xrange(master_node_count)]
......
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