diff options
Diffstat (limited to 'kazoo/testing')
-rw-r--r-- | kazoo/testing/common.py | 7 | ||||
-rw-r--r-- | kazoo/testing/harness.py | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/kazoo/testing/common.py b/kazoo/testing/common.py index 7918221..a349199 100644 --- a/kazoo/testing/common.py +++ b/kazoo/testing/common.py @@ -221,8 +221,9 @@ log4j.appender.ROLLINGFILE.File=""" ) self.process = subprocess.Popen(args=args) log.info( - "Started zookeeper process %s using args %s", + "Started zookeeper process %s on port %s using args %s", self.process.pid, + self.server_info.client_port, args, ) self._running = True @@ -304,12 +305,12 @@ log4j.appender.ROLLINGFILE.File=""" shutil.rmtree(self.working_path, True) - def get_logs(self): + def get_logs(self, num_lines=100): log_path = pathlib.Path(self.working_path, "zookeeper.log") if log_path.exists(): log_file = log_path.open("r") lines = log_file.readlines() - return lines[-100:] + return lines[-num_lines:] return [] diff --git a/kazoo/testing/harness.py b/kazoo/testing/harness.py index 880b1d9..d92a3fc 100644 --- a/kazoo/testing/harness.py +++ b/kazoo/testing/harness.py @@ -167,6 +167,9 @@ class KazooTestHarness(unittest.TestCase): def cluster(self): return get_global_cluster() + def log(self, level, msg, *args, **kwargs): + log.log(level, msg, *args, **kwargs) + @property def servers(self): return ",".join([s.address for s in self.cluster]) |