microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.71k stars 862 forks source link

Strip or honor ASCII color coding #1569

Open jessehouwing opened 6 years ago

jessehouwing commented 6 years ago

Agent Version and Platform

2.133.3 Windows | Linux

VSTS Type and Version

VisualStudio.com

If VisualStudio.com, what is your account name? http://psd30.visualstudio.com

What's not working?

When a commandline tool issues ASCII colour coding information (e.g. [?25l) they are shown in the logs and make it harder to read.

2018-05-19T15:43:16.7926995Z It looks like this is your first time using Cypress: 2.1.0
2018-05-19T15:43:16.7938560Z 
2018-05-19T15:43:16.7958404Z [?25l[15:43:05]  Verifying Cypress can run /opt/vsts/_work/r1/a/xxx-CI/src/node_modules/cypress/dist/Cypress [started]
2018-05-19T15:43:16.7980465Z [15:43:06]  Verifying Cypress can run /opt/vsts/_work/r1/a/xxx-CI/src/node_modules/cypress/dist/Cypress [completed]
2018-05-19T15:43:16.8000804Z [?25h
2018-05-19T15:43:16.8019478Z Opening Cypress...

It would be useful to either honor the color coding, somehow instruct/configure the terminal as monochrome or stripping out the nonsense characters.

tknerr commented 4 years ago

I can confirm on what @ppanyukov commented above in https://github.com/microsoft/azure-pipelines-agent/issues/1569#issuecomment-618505636 that it does not work for Release pipelines yet.

diegosucaria commented 4 years ago

Hello everyone!

No updates so far on this 2-years-old issue???

Did anyone found a workaround?

santiago-ld commented 4 years ago

Hello everyone!

No updates so far on this 2-years-old issue???

Did anyone found a workaround?

Nop, just using -no-color for terraform :/.

edjwhho commented 4 years ago

alternatively you can use azure cli task and run terraform commands manually which will give you colour output from terraform commands.


    - task: AzureCLI@1
      inputs:
        azureSubscription: 'terraform'
        scriptLocation: 'inlineScript'
        inlineScript: |
          #!/usr/bin/env bash
          echo "**************************************"
          echo "  setting up env vars"
          export ARM_SUBSCRIPTION_ID=$(az account show --query="id" -o tsv)
          export ARM_CLIENT_ID="${servicePrincipalId}"
          export ARM_CLIENT_SECRET="${servicePrincipalKey}"
          export ARM_TENANT_ID=$(az account show --query="tenantId" -o tsv)
          export ARM_ACCESS_KEY="${accessKey}"
          echo "***************************************"
          echo "  terraform init"
          terraform init
          echo "***************************************"
          echo "  terraform plan"
          terraform plan
ed-graham commented 3 years ago

Now 23rd December 2020 and the problem of output colours and formatting in release-pipeline logs (as so eloquently explained by @Marcus-James-Adams) is still at large. Don't suppose the product team fancies giving us all a late Christmas present? In the meantime, I'll continue to use the -no-color work-around suggested by @santiago-ld .

onlyann commented 3 years ago

The output from New-AzResourceGroupDeployment -Whatif isn't color coded using the AzurePowershell task from the pipeline web console. Is it related to this issue?

stvpalumbo commented 3 years ago

March 19th 2021 - Colors are still not supported properly in the Release Pipeline log viewer. This makes our selenium step so painful to debug...

image

JoseFMP commented 3 years ago

Would be great to have the colors supported. Otherwise when you copy the text directly from the output you copy those wrong characters instead of the right colored one's. Even if you lose the colors, I want to copy the right chars!

DmytroSokhach commented 3 years ago

Close this issue base on this colorful screenshot. :D

@TingluoHuang could you please share how did you get this screenshot? https://github.com/microsoft/azure-pipelines-agent/issues/1569#issuecomment-447024091

Marcus-James-Adams commented 3 years ago

A year on and yet still no response

jgabyey commented 3 years ago

Is there any ETA on a resolution to this issue? When I look at that StdErr portion of the log file at "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.12\Status" after running a CSE, I've run into the issue where PowerShell7 error messages are also outputting their ANSI escape characters, and it makes debugging a nuisance. See an example below:

{"name":"StdErr","status":"success","code":0,"formattedMessage":{"lang":"en-US","message":"\u001b[91mLog-Output: \u001b[0mC:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\0\\MainScript.ps1:85\r\n\u001b[96mLine |\r\n\u001b[96m 85 | \u001b[0m \u001b[96mLog-Output -output $_ -tag 3 -path $homeDir\u001b[0m\r\n\u001b[96m | \u001b[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\u001b[91m\u001b[96m | \u001b[91m2021/08/27 18:38:32.8804 FATAL ERROR\r\n\u001b[96m | \u001b[91mMissing Services \r\n\u001b[0m\r\n"}}]}}]

smeathers commented 2 years ago

Debugging a Teraform pipeline has lead me here. Like others I can make the logging more readable with the -no-color switch but the lack of colour in the output still reduces the readability of what I'm looking at. It would be a huge help if this could be supported.

jwedel commented 2 years ago

Would also appreciate this, as Cypress output in releases windows is pretty much unreadable: image

ransagy commented 2 years ago

Another chime in hope someone from MS responds to this in any way, including "this is backlog/icebox/what". @bryanmacfarlane @TingluoHuang @yaananth @vijayma @jtpetty - Can anyone point us at the right direction here?

anatolybolshakov commented 2 years ago

Hi everyone, this issue does not seem to be related to the agent itself (since agent does not handle logs view, but only sends them to server) - for the Azure DevOps features/issue reports I would suggest to open a ticket on https://developercommunity.visualstudio.com/search?space=21 to get right eyes on it.

wwestrop commented 2 years ago

For anyone following the thread: https://developercommunity.visualstudio.com/t/Colorful-logs-in-Release-Pipeline-as-wel/1652600

ghost commented 1 year ago

@jessehouwing why is this closed? I'm still seeing this issue, particularly on the "raw logs" view of Azure CI pipelines.

github-actions[bot] commented 1 year ago

This issue has had no activity in 180 days. Please comment if it is not actually stale

MattJeanes commented 1 year ago

This is still an issue unfortunately

FreddyAyala commented 1 year ago

Hello, this is still a big issue, are we actively working on it? If you give me access to the internal Repo here in MS I can try to give a hand. Thanks.

solidcloudio commented 1 year ago

Energizer bunny... Still going..

2023-07-27T03:17:59.8405393Z Resource and property changes are indicated with these symbols: 2023-07-27T03:17:59.8405937Z - Delete 2023-07-27T03:17:59.8406280Z + Create 2023-07-27T03:17:59.8406611Z ~ Modify 2023-07-27T03:17:59.8407101Z x NoEffect 2023-07-27T03:17:59.8407695Z = NoChange 2023-07-27T03:17:59.8408184Z * Ignore

williamdphillips commented 9 months ago

Any progress on this?

FreddyAyala commented 9 months ago

Bump, still very important feature missing.

martingalvan commented 9 months ago

@FreddyAyala I understand you work for Microsoft, correct? Could you solve this internally, or talk to whatever team's responsible for this?

mloskot commented 6 months ago

Dear Azure team, any news on fixing this annoyance?

or, do you really expect people to keep working around it with, for example:

cat log.txt | sed -e $'s/\x1b\[[0-9;]*m//g' > log.clean.txt
mloskot commented 6 months ago

The feedback I've just received from Azure DevOps to my request posted at https://twitter.com/mloskot/status/1760636981028016191 seems to suggest that begging Azure for attention here is a waste of time:

We understand how you feel. However, at the moment, our dev community is the best place to report issues or suggest ideas to our product team.

dewolfs commented 5 months ago

Looking forward to get this fixed

MaxSolabAzb commented 3 weeks ago

One more voice to get this fixed. Or at least give me an option to opt out of the colours so that my logs don't look like dog's vomit. And adding $PSStyle.OutputRendering = "PlainText" does not seem to do anything.

image

Depact commented 1 day ago

Another one bumps the thread. Looking forward to be fixed