简体   繁体   中英

AWS CodeBuild Colorized logs

I'm trying show colorized logs using colored from termcolor inside my script, when I run my script locally all is OK, but when my script is running by aws codePipeline --> codeBuild, the output format look like termcolor is not working.

First image show current output on aws.

Second image show the output from my local IDE (VS Code)

In my script I use something like: print(colored('Validating ObjecstNamePrefix parameter value...', 'yellow')) to show yellow text

The image number 3 show how I install (correctly) termcolor in my spec.yaml

The last image show a blue output, this output color is not handled from my script, is handle originally from aws logs console, for me this means that is possible play with colors.

Any help to solve it is welcome!

这是 aws 上的当前输出

这是所需的输出(如何在我的本地查看)

安装术语颜色

aws 原始日志的蓝色输出

Showing colors in Build logs tab on the Codebuild console is currently not possible. The blue color you mentioned is CodeBuild's internal implementation.

The reason for this gap is that the logs on the Build Logs tab are streamed from CloudWatch to the CodeBuild console. CloudWatch has no notion of fixed width fonts and colors. This makes any ASCII art of colors/indentations to not persist.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM