Logging from Build.cs

Is there any way to output log messages from the Build.cs file. I’d like to see if particular packages are being added or not.


Try this,
Log.TraceInformation(“your log text”)

public My_Module(ReadOnlyTargetRules targetInfo) : base(targetInfo)

error CS0103: The name `Log’ does not exist in the current context

You will need to put

using Tools.DotNETCommon;

in prior to that.

Works like a charm! This should be marked as the answer. Thanks Eason!

Edit: Not quite what I was hoping for, actually. In VS, the message doesn’t appear in the output every time. Seems that it only shows up if the build file has changed. The only way I’ve found to get a message every time is with a #pragma message() in a source file (which is ugly IMO)…

1 Like


using System.IO;