Skip to content

Commit

Permalink
Improve pipe debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sezanzeb committed Oct 20, 2024
1 parent fd5b2cc commit 9ee9353
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions inputremapper/configs/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def config_path() -> str:
def chown(path):
"""Set the owner of a path to the user."""
try:
logger.debug('Chown "%s", "%s"', path, UserUtils.user)
shutil.chown(path, user=UserUtils.user, group=UserUtils.user)
except LookupError:
# the users group was unknown in one case for whatever reason
Expand Down
4 changes: 2 additions & 2 deletions inputremapper/ipc/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, path):
PathUtils.mkdir(os.path.dirname(path))

if not os.path.exists(paths[0]):
logger.debug('Creating new pipe for "%s"', path)
logger.debug("Creating new pipes %s", paths)
# The fd the link points to is closed, or none ever existed
# If there is a link, remove it.
if os.path.islink(paths[0]):
Expand All @@ -84,7 +84,7 @@ def __init__(self, path):
os.symlink(f"{fds_dir}{self._fds[0]}", paths[0])
os.symlink(f"{fds_dir}{self._fds[1]}", paths[1])
else:
logger.debug('Using existing pipe for "%s"', path)
logger.debug("Using existing pipes %s", paths)

# thanks to os.O_NONBLOCK, readline will return b'' when there
# is nothing to read
Expand Down

0 comments on commit 9ee9353

Please sign in to comment.