Closed Kontekst closed 2 years ago
I have created example public repo and pipeline with Minimal, Reproducible Example
test.cake https://dev.azure.com/tomaszkontek/FeaturesTesting/_git/CakeVerbosityOutput?path=%2Ftest.cake
release with corrupted output https://dev.azure.com/tomaszkontek/FeaturesTesting/_releaseProgress?_a=release-pipeline-progress&releaseId=2
This is due to the fact that Azure DevOps supports colorization in the output using ANSI escape codes. Cake (or rather the underlying spectre.console) detects this and uses these codes to colorize the output.
However, in the downloaded logs which are (naturally) text-only, these escape codes appear as you highlighted above. I would suggest having a look at Cake.Buildsystems.Module, which supports changing the output according to the underlying CI system. Cake.Buildsystems.Module currently has a similar problem (see https://github.com/cake-contrib/Cake.BuildSystems.Module/issues/108) but it seems that might be fixed soon.
I have fixed this behavior by setting 'NO_COLOR' environment variable on agent host. https://cakebuild.net/docs/running-builds/configuration/default-configuration-values#disable-colors-in-output-text
I think this issue can be closed.
Cake logging commands using interpolation arguments are adding additional characters in AzDevOps output during release. Similar characters are sometimes added for default information printed on start/end of task (like "Executing task..", "Finished executing task...").
I ran below Cake script in Cake task with version 2*(2.1.0 in logs) during AzDevOps Release on my custom agent , problem occurs for 3 verbosity levels(Normal, Verbosity, Diagnostic).
`Task("Default") .Does(() => { var testInfo = "Hello world";
}); RunTarget("Default");`