Skip to content

Commit

Permalink
teach eden debug log --upload to use IOWithRedaction
Browse files Browse the repository at this point in the history
Summary: `eden rage` was recently taught to run output through redaction. This diff teaches `eden debug log` to do the same, as this uses the same code path as `rage` and needs to match the new expected types

Reviewed By: lXXXw

Differential Revision: D67061776

fbshipit-source-id: 9846a5f0d8e91cd4787d417ac91420439bfa0d5d
  • Loading branch information
genevievehelsel authored and facebook-github-bot committed Dec 11, 2024
1 parent 8b9a294 commit f5be753
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions eden/fs/cli/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -1360,17 +1360,14 @@ def upload_logs(
proc: Optional[subprocess.Popen] = None
if rage_processor and not args.stdout:
proc = subprocess.Popen(shlex.split(rage_processor), stdin=subprocess.PIPE)
sink = proc.stdin
sink = rage_mod.IOWithRedaction(cast(IO[bytes], proc.stdin))
else:
proc = None
sink = sys.stdout.buffer
sink = rage_mod.IOWithRedaction(sys.stdout.buffer)

# pyre-fixme[6]: Expected `IO[bytes]` for 2nd param but got
# `Optional[typing.IO[typing.Any]]`.
rage_mod.print_log_file(eden_log_path, sink, args.full, args.size)
if proc:
# pyre-fixme[16]: `Optional` has no attribute `close`.
sink.close()
sink.wrapped.close()
proc.wait()
return 0

Expand Down

0 comments on commit f5be753

Please sign in to comment.