Log rotation.

This commit is contained in:
tecnovert
2025-03-12 10:40:32 +02:00
parent 7d5f7e0936
commit 826527fea9
10 changed files with 313 additions and 276 deletions
+2 -4
View File
@@ -408,9 +408,8 @@ class Test(unittest.TestCase):
settings_path = os.path.join(basicswap_dir, cfg.CONFIG_FILENAME)
with open(settings_path) as fs:
settings = json.load(fs)
fp = open(os.path.join(basicswap_dir, "basicswap.log"), "w")
sc = BasicSwap(
fp, basicswap_dir, settings, "regtest", log_name="BasicSwap{}".format(i)
basicswap_dir, settings, "regtest", log_name="BasicSwap{}".format(i)
)
cls.swap_clients.append(sc)
sc.setDaemonPID(Coins.BTC, cls.daemons[0].handle.pid)
@@ -423,7 +422,7 @@ class Test(unittest.TestCase):
sc.start()
t = HttpThread(sc.fp, TEST_HTTP_HOST, TEST_HTTP_PORT + i, False, sc)
t = HttpThread(TEST_HTTP_HOST, TEST_HTTP_PORT + i, False, sc)
cls.http_threads.append(t)
t.start()
@@ -484,7 +483,6 @@ class Test(unittest.TestCase):
t.join()
for c in cls.swap_clients:
c.finalise()
c.fp.close()
stopDaemons(cls.daemons)