Reputation: 19203
I'm looking at https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash and I see you can add messages (that if integrated with GitHub can be posted as PR annotations) using the ##vso[task.logissue type=error]Something went very wrong.
format.
I don't see anything about multiline messages. Does Azure Dev Ops support that? How can I add a multiline annotation.
Upvotes: 1
Views: 1581
Reputation: 21
Here the command that worked fine for me, it will replace '\n' line returns characters in your text :
Sed command will replace all '\n' with %0D%0A and add a final '\n' at the end of the text.
sed -z 's/\n/%0D%0A/g;s/,$/\n/'
Upvotes: 0
Reputation: 51093
You could add %0D%0A
in your message to wrap lines of your log. For a long single line message, it looks like something as below:
After add %0D%0A
,
##vso[task.logissue type=error]Something went very wrong.Add Workspace. %0D%0AIf Workspace Manager is empty, probably you didn't added one yet.%0D%0AClick on Add button ....
It change to below format:
For some other kind of error/warning message, you could also take a look at this useful blog-- Improving Logs in Azure DevOps Service with special ‘tags’
Upvotes: 2