Reputation: 2065
In my azure devops release pipeline, i'm running a python script, which eventually logs warning or error based on the my custom logger package. So, in my std output of the azuredevops I see it's working fine.
But, I'm wondering is it possible to display the number of warnings or error on the badge like this below image. I think, you have to use command line loggings. But question comes how can I track the warnings or errors from AzDevops standard output using python.
Any idea and suggestions are welcome.
Upvotes: 4
Views: 3419
Reputation: 21
You can utilize output the logging commands from python with a print function call (python3 - if using python 2, you can import print function from futures)
print("##[group]Beginning of a group")
print("##[warning]Warning message")
print("##[error]Error message")
print("##[section]Start of a section")
print("##[debug]Debug text")
print("##[command]Command-line being run")
print("##[endgroup]")
Upvotes: 0
Reputation: 2065
I tried using this in my python package and it works the way I wanted to.
subprocess.call(["echo", "##vso[task.logissue type=warning;]some warning"])
May be someone can get help out of this.
Upvotes: 4