Skip to content

Commit c6afdb7

Browse files
authored
Build: truncate command output (#9346)
The logic wrote in #9286 was incorrect. The logs keeps showing a lot of the command's output. We want to take the first 10 lines and the last 10 lines.
1 parent e94c260 commit c6afdb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@ def run_command_class(
458458
msg = "Command failed"
459459
build_output = ""
460460
if build_cmd.output:
461-
build_output += "\n".join(build_cmd.output.split("\n")[10:])
462-
build_output += "\n ..Output Truncated.."
463461
build_output += "\n".join(build_cmd.output.split("\n")[:10])
462+
build_output += "\n ..Output Truncated.. \n"
463+
build_output += "\n".join(build_cmd.output.split("\n")[-10:])
464464
log.warning(
465465
msg,
466466
command=build_cmd.get_command(),

0 commit comments

Comments
 (0)