more logging
This commit is contained in:
parent
f41a21208e
commit
d7d5e6ad5a
@ -484,6 +484,7 @@ def main():
|
|||||||
pipe_buffer = b""
|
pipe_buffer = b""
|
||||||
while pollc > 0 and len(events) > 0:
|
while pollc > 0 and len(events) > 0:
|
||||||
for rfd, event in events:
|
for rfd, event in events:
|
||||||
|
logger.debug("rfd=%d, event=%b", rfd, event)
|
||||||
if event & select.POLLOUT:
|
if event & select.POLLOUT:
|
||||||
if rfd == proc.stdin.fileno():
|
if rfd == proc.stdin.fileno():
|
||||||
if chunk := pipe_buffer[:PIPE_BUF]:
|
if chunk := pipe_buffer[:PIPE_BUF]:
|
||||||
@ -495,16 +496,21 @@ def main():
|
|||||||
pipe_buffer = pipe_buffer[PIPE_BUF:]
|
pipe_buffer = pipe_buffer[PIPE_BUF:]
|
||||||
elif pipe_buffer := next(download_stream, b""):
|
elif pipe_buffer := next(download_stream, b""):
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Accepted chunk of length %d", len(chunk)
|
"Accepted chunk of length %d",
|
||||||
|
len(pipe_buffer),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
proc.stdin.close()
|
proc.stdin.close()
|
||||||
if event & select.POLLIN or event & select.POLLPRI:
|
if event & select.POLLIN or event & select.POLLPRI:
|
||||||
if rfd == proc.stdout.fileno():
|
if rfd == proc.stdout.fileno():
|
||||||
|
logger.debug("Reading line from stdout...")
|
||||||
if line := proc.stdout.readline():
|
if line := proc.stdout.readline():
|
||||||
|
logger.debug("Done")
|
||||||
stdout_logger.info(line[:-1])
|
stdout_logger.info(line[:-1])
|
||||||
if rfd == proc.stderr.fileno():
|
if rfd == proc.stderr.fileno():
|
||||||
|
logger.debug("Reading line from stderr...")
|
||||||
if line := proc.stderr.readline():
|
if line := proc.stderr.readline():
|
||||||
|
logger.debug("Done")
|
||||||
stderr_logger.info(line[:-1])
|
stderr_logger.info(line[:-1])
|
||||||
if event & select.POLLERR:
|
if event & select.POLLERR:
|
||||||
if rfd == proc.stdin.fileno():
|
if rfd == proc.stdin.fileno():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user