Skip to content

Commit 8301add

Browse files
committed
Logging statements: Use f-strings
1 parent b1a10bd commit 8301add

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/libtmux/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
267267
else:
268268
self.stdout = stdout_split
269269

270-
logger.debug("self.stdout for {}: \n{}".format(" ".join(cmd), self.stdout))
270+
logger.debug(
271+
"self.stdout for {cmd}: {stdout}".format(
272+
cmd=" ".join(cmd), stdout=self.stdout
273+
)
274+
)
271275

272276

273277
# class TmuxMappingObject(t.Mapping[str, t.Union[str,int,bool]]):

src/libtmux/pytest_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def session(request: pytest.FixtureRequest, server: Server) -> "Session":
204204
pass
205205

206206
for old_test_session in old_test_sessions:
207-
logger.debug("Old test test session %s found. Killing it." % old_test_session)
207+
logger.debug(f"Old test test session {old_test_session} found. Killing it.")
208208
server.kill_session(old_test_session)
209209
assert TEST_SESSION_NAME == session.get("session_name")
210210
assert TEST_SESSION_NAME != "tmuxp"

src/libtmux/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def attached_sessions(self) -> t.List[Session]:
406406
attached = session.get("session_attached")
407407
# for now session_active is a unicode
408408
if attached != "0":
409-
logger.debug("session %s attached", session.get("name"))
409+
logger.debug(f"session {session.get('name')} attached")
410410
attached_sessions.append(session)
411411
else:
412412
continue
@@ -608,7 +608,7 @@ def new_session(
608608
"Session named %s exists" % session_name
609609
)
610610

611-
logger.debug("creating session %s" % session_name)
611+
logger.debug(f"creating session {session_name}")
612612

613613
sformats = formats.SESSION_FORMATS
614614
tmux_formats = ["#{%s}" % f for f in sformats]

0 commit comments

Comments
 (0)