How to enable diagnostic verbosity for Cake
Asked Answered
E

1

28

I am having some problems running my build.cake file, but I can't immediately see what the problem is. Is there a way to enable diagnostic verbosity, so I can get more information about what is going on, and how to fix the problem?

Ern answered 29/7, 2016 at 12:17 Comment(0)
W
44

Yes, you can easily enable diagnostic verbosity in Cake. This allows you to see much more information about the Cake execution, including the actual commands, and arguments, that are passed to the numerous underlying tools that Cake can call on your behalf. This can be especially useful if you are finding issues when calling tools, and things aren't working as expected. By getting the command that is being called, you can test this outwith Cake to make sure it is working as expected.

How you enable diagnostic verbosity really depends on how you are calling the cake.exe.

Directly

cake.exe --verbosity=diagnostic

Via PowerShell Bootstrapper

.\build.ps1 -Verbosity Diagnostic

Via Bash Bootstrapper

.\build.sh --verbosity=diagnostic

NOTE: Another option might be to debug your build.cake file. This can be done by passing --debug into cake.exe, and then attaching the debugger. More information on this can be found here.

In addition, you can also pass other options for the Verbosity flag. These are described in detail here. These options are:

  • Minimal
  • Normal
  • Quiet
  • Verbose
Windham answered 29/7, 2016 at 12:25 Comment(8)
In the latest boostrap build.sh file I picked up from the resources GitHub repo, the Bash command now seems to be identical to the direct approach: .\build.sh --verbosity=diagnostic. I don't know when the change occurred, and there's no versioning info in that file (possibly this commit), but it might be worth a mention here.Slicer
Good idea! Yeah, we don't version the bootstrapper files, but rather just push to the master branch. Perhaps we should add some version information.Windham
The answer above is also missing Diagnostic as a verbosity option.Jannet
@ThulaniChivandikwa I am not sure I follow what you are saying. The answer is centred around the usage of the Diagnostic Verbosity option, and then it shows the other options that can also be passed in. I don't see anything missing. Can you elaborate?Windham
@GaryEwanPark A moment of madness there on my part I guess, not even sure how I made the mistake now.Jannet
@GaryEwanPark Can you confirm is the level of verbosity in order (from least to most): Quiet, Minimal, Normal, Verbose, Diagnostic ..? When runing using Quiet it doesnt seem to be "quiet" to me :-)Barbecue
@Barbecue check the enumeration integer value on the linked documentation page. That shows the correct order.Windham
I am not sure I follow what you are asking. Can you elaborate? Or perhaps ask another question? The Information alias writes out a log message to the console, if the current logging level allows it.Windham

© 2022 - 2024 — McMap. All rights reserved.