Gerrie Schenck
Gerrie Schenck

Reputation: 22368

Custom build task: how to write output to the build log file

I need my custom team build task to write some output to the build log file. How do I do this?

The Execute method inherited from the Task baseclass only has a boolean as return parameter.

Upvotes: 1

Views: 1319

Answers (1)

technophile
technophile

Reputation: 3676

Assuming you did the smart thing and inherited from Microsoft.Build.Utilities.Task, you can simply call Log.Log[Message|Warning|Error] to log with the appropriate level.

Alternately, you can use the BuildEngine you're given (in the ITask.BuildEngine property) to call the Log[X]Event methods.

Upvotes: 3

Related Questions