I'm using the below cake script to compile my C#
project. There are few warning messages shown in PowerShell
while executing the script. I like to log the warnings in a text file which is in a physical location(ex: D:\WarningReport.txt)
.
The below is the cake script task I use to compile the project.
Task("Build")
.Does(() =>
{
if(IsRunningOnWindows())
{
MSBuild("./src/Example.sln", settings =>
settings.SetConfiguration(configuration));
}
});
I like to add something like below,
LogWarningMessagesTo("D:\WarningReportes.txt");
LogErrorMessagesTo("D:\ErrorReportes.txt");
How to do this?
If it's warnings and errors from MSBuild alias you want to log that's certainly possible using the AddFileLogger extension method on the MSBuildSettings parameter.
Basically change
to