Skip to content

Commit aa045c5

Browse files
committed
Truncate output that we log from commands to 10 lines
Make output nicer and add first/last 10 lines Log correct string
1 parent 0f04b46 commit aa045c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +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-
msg += ':\n{out}'.format(out=build_cmd.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])
461464
log.warning(
462465
msg,
466+
command=build_cmd.get_command(),
467+
output=build_output,
463468
project_slug=self.project.slug if self.project else '',
464469
version_slug=self.version.slug if self.version else '',
465470
)

0 commit comments

Comments
 (0)