Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print customized message in code to Teamcity build log in C#

Recently I need to print some special message in C# code to Teamcity build log when executing, Does anyone know how to do that?

like:

//dosomething

//print messages

hope in Teamcity build log can see these messages.

thanks in advance

like image 853
user498151 Avatar asked Nov 25 '10 04:11

user498151


People also ask

How do I process service messages in TeamCity?

To be processed by TeamCity, they need to be written to the standard output stream of the build, that is printed or echoed from a build step. It is recommended to output one message per line (by dividing them with symbols) and flush the stdout buffer after each service message.

What is a build log in TeamCity?

A build log is an enhanced console output of a build. It is represented by a structured list of the events which took place during the build. Generally, it includes entries on TeamCity-performed actions and the output of the processes launched during the build.

How do I change the build status in TeamCity?

To set the status and/or change the text of the build status (for example, note the number of failed tests if the test framework is not supported by TeamCity), use the buildStatus message with the following format: Copied! status (optional): use the SUCCESS value to change the build status to Success.

How do I report test results in TeamCity?

If TeamCity doesn't support your testing framework natively, it is possible to modify your build script to report test runs to the TeamCity server using service messages. This makes it possible to display test results in real-time, make test information available on the Tests tab of the Build Results page.


1 Answers

Use Service Messages, for example writing this string to the stdout ##teamcity[message text='Hello from TeamCity'] will cause Hello from TeamCity to appear in the build log.

like image 78
Jack Ukleja Avatar answered Sep 28 '22 08:09

Jack Ukleja