AragornSG
AragornSG

Reputation: 653

C# Debug.log stops printing info after first launch of the method

I'm building a game in Unity 5, which communicates with server retrieving JSON objects using http. Those requests are performed by a separate class, which I'm calling after a button is pressed. Everything seems to be working without a problem, but strange behavior of Debug.log makes me worried that I'm missing something important.

Here is the code launched by the button click:

public class urlLauncher : MonoBehaviour {
    public GameObject serverBridge;
    public GameObject banner;

    public void loadURL(string urlToLoad)
    {
        Debug.Log("load: "+urlToLoad);
        banner.GetComponent<TextMeshProUGUI>().SetText(urlToLoad, 0);
        serverBridge.GetComponent<talkToServer>().downloadUrl(urlToLoad);
    }
}

As I said, this is working fine, each time button is pressed text inside the banner changes and data is loaded from server. However Debug.log (and subsequent Debug.logs located further in the chain of methods) prints out "load: ..." only the first time button is pressed. This seems to be consistent behavior across all the buttons which use the urlLauncher class, though another another peculiarity has occurred to me:

I'm relatively new to C#, but I'm not aware of anything that could stop Debug.log from working. Appreciate any hints on what might be going on here!

Upvotes: 2

Views: 310

Answers (1)

slumtrimpet
slumtrimpet

Reputation: 3267

Make sure "Collapse" isn't toggled on your Console here:

Collapse Image

Upvotes: 2

Related Questions