Console not outputting from Debug.Log()

I’m trying to Debug my code to see how far it makes it, but i’m not getting any response from my Debug.Log() functions, here is my code:

using UnityEngine;
using System.Collections;
  
public class numberOfTaps : MonoBehaviour 
{
	float timer;
	private int tapCounter = 0;
	
	void Update () 
	{
		Debug.Log ("Hello"); //It doesn't even print this?
		int number = Random.Range(50, 250);
		Debug.Log (number);
		
		for (int i = 0; i < Input.touchCount; ++i)
		{
			if (Input.GetTouch(i).phase == TouchPhase.Began) 
			{
				if(Input.GetTouch(i).tapCount == 1)
				{
					tapCounter += 1;
				}
			}
		}
		
		Debug.Log (tapCounter);
		if(tapCounter == number)
		{
			renderer.material.color = Color.red;
		}
    }
}

As you can see, my first “Hello” doesn’t even get displayed on the console, now i am quite tired but I cant seem to see anything wrong, maybe a few sets of eyes can point out a reason for this?

EDIT:

I’ve now taken all code except for the Debug.Log("Hello"); and I’m still getting nothing, not sure what’s happening

1 Like

Check to see if that particular output has been enabled in the console.

You can hide certain types of messages.

Se below

I seem to have solved the problem by deleting the scene and script attached to the object and creating new ones, I used the exact same code in my script and it worked, don’t know what caused it

i just fixed the problem…

step 1 : ctrl + shift + c
step 2 : enable/click on 3 icons at right console as picture below:

The problem seems to be that the compiler gets confused between the Deug() of the c# systems and the Debug() from unity engine, my code simply got fixed after I added {{{ UnityEngine. }}}
example:

UnityEngine.Debug.Log("let's goooo");

Debug.Log not showing…
Remove Component (script name), Add Component (script name) fixed it for me. Didn’t need to delete scene.

You can search all project, find code like that:

UnityEngine.Debug.unityLogger.logEnabled = false;

in order enable log edit code like that:

UnityEngine.Debug.unityLogger.logEnabled = true;

@MonolithTyriss @JayFitz91 Try the suggestions from this link:

https://forum.unity.com/threads/no-output-from-debug-log.498106/

Unity is broken. Everytime you update it’s just a faff time and time again. It loses references, the build breaks, manifests need clearing, caches need removing then run time bugs on top of that as a result of all the breakages.

Absolutely tired of fixing projects that haven’t changed since the last time it was working. It’s like all you have to do to break a project is not load it for a week.

I know this is Old, but exiting Unity and opening it again fixed it for me.

Here’s a quick fix that worked for me. I can’t guarantee that it will work for everyone with the same problem.

I had the same problem while using Visual Studio Code. All I did was restart it and the console was logging again. VSC wasn’t synchronizing with Unity Editor.

However, I lost all the recent changes I had made to the code. So be sure to first copy your code to it somewhere else.

Try ReImportAll.

Making the console big worked for me

Append this code in settings.json of you project.

"Logs/": true,
"logs/": true,

then you may solve this problem.