From 9787796fe21be1ea563558fd17dac974e8b333d6 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Fri, 17 Jun 2022 13:03:26 +0200 Subject: [PATCH] Build: truncate command output 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. --- readthedocs/doc_builder/environments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs/doc_builder/environments.py b/readthedocs/doc_builder/environments.py index 96be8c18bbd..5d6007755b1 100644 --- a/readthedocs/doc_builder/environments.py +++ b/readthedocs/doc_builder/environments.py @@ -458,9 +458,9 @@ def run_command_class( msg = "Command failed" build_output = "" if build_cmd.output: - build_output += "\n".join(build_cmd.output.split("\n")[10:]) - build_output += "\n ..Output Truncated.." build_output += "\n".join(build_cmd.output.split("\n")[:10]) + build_output += "\n ..Output Truncated.. \n" + build_output += "\n".join(build_cmd.output.split("\n")[-10:]) log.warning( msg, command=build_cmd.get_command(),