Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity not logging debug entries

Discussion in 'Scripting' started by DoomDude99, Oct 28, 2019.

  1. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    87
    For some reason unity stopped logging entries on android; Debug.Log() no longer works.

    My setup:

    unity-debug-log.png

    unity-debug-log-2.png

    How can I reenable Debug.Log?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,748
    Look at the top right of your Console window. Are all three buttons (Log, Warning, Error) pressed?
     
    vitaliy-ostrovsky and DoomDude99 like this.
  3. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    87
    Yes, the only log entries I get, are the build notifications from unity. There are no in code log entries.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Show the code that is not working.
     
    DoomDude99 likes this.
  5. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    87
    Nothing out of the ordinary. Most files have an entry similar to:

    Code (CSharp):
    1.     // Use this for initialization
    2.     void Start () {
    3.  
    4.         ///////////////////////
    5.         /// Add Debug.Log() for testing
    6.         ///////////////////////
    7.         Debug.Log("FileName.cs -- TEST");
    8.         // Rest of the code
    9.         ...
    10.      }
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    When did this start happening, do they work on a new project? Do you have that script attached to an object?
     
    DoomDude99 likes this.
  7. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    87
    It seems that this occurs in new projects as well:

    dbg-logcat.png

    The script DbgLogcat.cs attached to the camera:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class DbgLogcat : MonoBehaviour {
    6.  
    7.     // Use this for initialization
    8.     void Start () {
    9.         Debug.Log("TEST DEBUG -- TEST DEBUG -- TEST DEBUG");
    10.     }
    11.    
    12.     // Update is called once per frame
    13.     void Update () {
    14.         Debug.Log("UPDATE TEST DEBUG -- UPDATE TEST DEBUG -- UPDATE TEST DEBUG");
    15.     }
    16. }
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    You are discussing two different things. The build is failing, which is separate from Debug.Log not working. Do you see the debug statements when you run the game in the Editor, in the Console window? If the game doesn't build, you wouldn't be able to install it on an Android device.
     
    DoomDude99 likes this.
  9. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    87
    Fixed it. Apparently needed to refresh the "Editor" in unity.
     
  10. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,593
    I cant get this to work either, seems ok until I swap scene in my build, then nothing shows any ideas?