Skip to content

Commit

Permalink
test/pylib: API get/set logger level of Scylla server
Browse files Browse the repository at this point in the history
Provide helpers to get and set logger level for Scylla servers.

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>

Closes #12394
  • Loading branch information
alecco authored and nyh committed Dec 25, 2022
1 parent ea7e23b commit 1bfe234
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/pylib/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ async def get_enabled_injections(self, node_ip: str) -> list[str]:
assert(type(e) == str for e in data)
return data

async def get_logger_level(self, node_ip: str, logger: str) -> str:
"""Get logger level"""
return await self.client.get_text(f"/system/logger/{logger}", host=node_ip)

async def set_logger_level(self, node_ip: str, logger: str, level: str) -> None:
"""Set logger level"""
assert level in ["debug", "info", "warning", "trace"]
await self.client.post(f"/system/logger/{logger}?level={level}", host=node_ip)


@asynccontextmanager
async def inject_error(api: ScyllaRESTAPIClient, node_ip: IPAddress, injection: str,
Expand Down

0 comments on commit 1bfe234

Please sign in to comment.