4

My task is very simple, I put in the Main method two lines:

Debug.Log("App START Debug.Log");
Debug.unityLogger.Log("App", "START Debug.unityLogger.Log");

and want to see these logs in the output if the app is running. If I set the run option as Releasethe app starts, but I don't see these logs. If I set the run option as Debug and try to start, I get an error popup:

Unable to activate Windows Store app ´Template3D_pzq3xp76mxafg!App´

and the app doesn't start at all.

EDIT: according to comment of @Perazim, I have also tried:

System.Diagnostics.Debug.WriteLine("App START Debug.Log");

No effect in Release and Debug mode.

EDIT 2:

System.Diagnostics.Debug.WriteLine("App START Debug.Log");

works, if I put it in other methods, but doesn't work in the Main() method.

Draken
  • 3,134
  • 13
  • 34
  • 54
Alexander Tumanin
  • 1,638
  • 2
  • 23
  • 37

3 Answers3

0

Debugger.Log for the output to debugger. Debug.WriteLine prints to listeners. If there is no listeners, it will not work.

Tania Chistyakova
  • 3,928
  • 6
  • 13
0

My application stopped writing output to the output window with the System.Diagnostics.Debug.Writeline in debug mode. This all happened after the latest Microsoft Updates.

I created a new application just to see if it was my current application, and the new application would not write to the output window either.

Then I decided to right click on the Output Pane in Visual Studio and what do I see, Program Output unchecked.

Program Output Unchecked

I checked this and my Debug.Writeline works again.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Zane Ross
  • 1
  • 1
-1

In unity you can use/see debug.log(); in Visual Studio you need to use Console.WriteLine();

Mehul Kabaria
  • 6,404
  • 4
  • 25
  • 50
Perazim
  • 1,501
  • 3
  • 19
  • 42