Skip to content

Commit 32835e1

Browse files
committed
Make output nicer and add first/last 10 lines
1 parent 10fe735 commit 32835e1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,16 @@ def run_command_class(
455455

456456
if build_cmd.failed:
457457
if warn_only:
458-
msg = 'Command {cmd} failed'.format(cmd=build_cmd.get_command())
458+
msg = "Command failed"
459+
build_output = ""
459460
if build_cmd.output:
460-
truncated_output = "\n".join(build_cmd.output.split("\n")[:10])
461-
msg += ":\n{out}".format(out=truncated_output)
461+
build_output += "\n".join(build_cmd.output.split("\n")[10:])
462+
build_output += "\n ..Output Truncated.."
463+
build_output += "\n".join(build_cmd.output.split("\n")[:10])
462464
log.warning(
463465
msg,
466+
command=build_cmd.get_command(),
467+
output=truncated_output,
464468
project_slug=self.project.slug if self.project else '',
465469
version_slug=self.version.slug if self.version else '',
466470
)

0 commit comments

Comments
 (0)