How to copy multiple lines of codebuild logs?

147 Views Asked by At

I am unable to copy the CodeBuild logs properly. It automatically adds empty lines between CB logs. Is there a way to prevent that from happening?

For an example, here's the CodeBuild Log I want to copy codebuild_log

However, it gets copied as follows

============================= test session starts ==============================



platform linux -- Python 3.5.2, pytest-4.4.0, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3



cachedir: .pytest_cache



rootdir: /home/ubuntu/test/sagemaker_tests/pytorch/training



plugins: rerunfailures-8.0, forked-1.3.0, requests-mock-1.6.0, xdist-1.28.0, cov-2.7.1



collecting ... collected 7 items





- generated xml file: /home/ubuntu/test/training_1.6.0-gpu-py36-cu101-ubuntu16.04-pr-21_sm_local.xml -



==================== 1 passed, 6 skipped in 184.74 seconds =====================

Is there a way to prevent this additional empty lines from getting getting added automatically while copying CB logs to clipboard?

1

There are 1 best solutions below

0
On BEST ANSWER

Temporary workaround is

  1. Copy the Codebuild log
  2. Paste it to Text editor of your choice [e.g. Sublime Text]
  3. Use Find & Replace with Regex to remove multiple empty lines

In my case, 3 empty lines were inserted between 2 CodeBuild log lines So I used regex "\n\n\n" and replaced it with Nothing [left it empty]

  1. Then copied the updated text & pasted it to the actual destination