How to properly work with Log.Debug


#1

What is the expected way to work with Log.Debug()?
Is there a manual page I missed? If not could we create one?

Currently I use the Start() method of my script to do the following

Log.ActivateLog(SiliconStudio.Core.Diagnostics.LogMessageType.Debug);

After which I can use the following anywhere in the script

Log.Debug("my message");

And then when debugging from the Xenko Editor as soon as the first Log.Debug line is hit, a secondary console window pops up with the output from the logger. This window also steals focus from your game.

Here are a few questions:

  • Why is LogMessageType.Debug not activated by default?
  • Can I maybe access the Logger from the static void Main() method so I can set it?
  • Why isn’t Logger a GameSystem service?
  • What is the DebugConsoleSystem and why isn’t it an ILogger?
  • Would having an ILogger that forwards to Debug.WriteLn so it shows up in Visual Studio and Xenko Editor be a solution?

How I expect the logger to work is an ILogger in the game.GameSystem like all the others.
There is a Logger that logs to Debug.WriteLn so it shows up in vs and xenko editor output.
If it is available log to the debug renderer (something similar to the DebugConsoleSystem I think?)
If Debug constant is set, Log.ActivateLog(SiliconStudio.Core.Diagnostics.LogMessageType.Debug) is called.