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. Dismiss Notice

Unity Development Build shows on Debug.error in build console !

Discussion in 'Editor & General Support' started by Sahkan, Jul 13, 2014.

  1. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Last edited: Jul 14, 2014
  2. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Bump ! Anyone ?...
     
  3. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Rather than bumping, please take the time to improve your question. You get no answers when your question isn't understood.
     
  4. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Build = Stand Alone Game = A build you export out of unity, (File ->build settings...).
    Inside the "build settings" window, i check 2 checkboxes ,one says "Development Build" and the other says "Script Debbuging" ( I'v tried it with "Development Build" checked and "Script Debbuging" uncheckd and it still gave me the same results).

    Now, when i open this Build, I can see the errors on the console which is located in the left-down side of the screen ( which is transparent and it is very hard to read some of the errors,they are printed in red, and on some backgrounds it is barely readable).

    However, i can't see the normal logs or warnings in this console.

    Log commands:

    Debug.LogError - Works .
    Debug.Log - Doesn't Work .
    Debug.LogWarning - Doesn't Work .

    Now, how can i make it display all of the Logs commands ?
     
    Last edited: Jul 14, 2014
  5. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Bump ! I know i was very clear. can someone from Unity's team answer this one please ?
     
  6. John Fallon

    John Fallon

    Unity Technologies

    Joined:
    Jul 1, 2014
    Posts:
    44
    Considering this is a community site, it's quite surprising that nobody in the community has responded and tried to help you. I will take a look at this now and try to find a solution to the problem. Thank you for your patience.
     
  7. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Thank you for helping me :D
     
  8. John Fallon

    John Fallon

    Unity Technologies

    Joined:
    Jul 1, 2014
    Posts:
    44
    I am looking into this problem and I will post a reply if I find a solution. In the meantime, an alternative implementation which may be useful to you is to use the DebugConsole script detailed in the following documentation:

    http://wiki.unity3d.com/index.php?title=DebugConsole

    1) In your project, add the DebugConsole script to your Standard Assets folder. Simply right click on the Standard Assets folder, click Create -> C# Script. Name the script DebugConsole.cs (it must have this name). Copy and paste the code from the DebugConsole wiki page into your new script and save the file.

    2) Create a new empty game object in your project. Click GameObject -> Create Empty. Rename the new GameObject to something more meaningful such as "Debug Console".

    3) Drag the DebugConsole script onto the new empty game object.

    4) To call the DebugConsole script from your scripts, just type:

    DebugConsole.someFunction()

    5) To display normal logs, warnings or errors, replace someFunction() with:

    Log (string message, string color)

    This adds a message to the list. The color is a string either "normal", "warning" or "error". The color argument is optional and if omitted, the color will default to "normal". For other functions, please see the documentation in the link provided above.

    6) Finally, save your scripts, scene and project.

    Please note that you can also change the settings of the Debug Console by clicking on it in the inspector and adjusting the values. Here you can change the log type colors which makes the logs much more readable against certain backgrounds.
     
  9. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Thanks ! Just tested it and this is looking very nice.
    I will wait till the normal debug will work though, working with a team, and we are already been using a lot of the normal Debug.Log.
     
  10. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Are you talking about the build console that shows error messages in the bottom-left corner of game builds over the top of the game graphics?

    I don't think this was ever meant to show all debug logs, if it did it would be almost useless - as it is now, it will show you errors while running the build, which is helpful rather than spamming every single debug message in the small space that it has.

    If you want the full log with Debug.Log, LogWarning and LogError, you should look through the log file - http://docs.unity3d.com/Manual/LogFiles.html
     
  11. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    BFS KyleMember This is partially true because sometime i need to know what is going on when i test a 2Players game and i cant open more then one Unity editor as far as i know...

    Edit : It seems like i can open Unity editor more then one time, however, i can't open the same project twice, so need to make a new copy of the project every time i want to debug it this way...

    Is there anyway to make it possible ? This would be the ultimate debugging solution !
     
    Last edited: Jul 16, 2014
  12. John Fallon

    John Fallon

    Unity Technologies

    Joined:
    Jul 1, 2014
    Posts:
    44
    I have confirmed that the Development Console is not intended to be used for outputting all debug logs, only exceptions and errors. The Console window in the editor is used instead to show all debug logs from your project.

    As an alternative, you can implement the solution outlined previously or you could take a look at other implementations available on the Unity Asset Store, for example, the Developer Console detailed in the following forum post:

    http://forum.unity3d.com/threads/developer-console-released.138321/

    If you would like to make this issue an official feature suggestion, please post it on our feedback page. Here, people can vote for your suggestion to be implemented. If it gathers enough votes then it can get noticed very quickly.

    http://feedback.unity3d.com/
     
    Last edited: Jul 16, 2014
  13. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287

    Yes, you can only have a single editor running at a time. Typically people build a standalone version of the game, and then run that. This standalone can then talk to the editor, and you can debug and test the editor version of the game.


    There a lots of open source solutions, including the one @john.fallon mentioned. The debug log is customisable, see:

    http://docs.unity3d.com/ScriptReference/Application.RegisterLogCallback.html

    So, you can intercept the messages that Debug.Log, Debug.LogWarning etc generate, and either display them as an overlay using the GUI features, or write them to a text file with a unique name. When I am doing any kind of development on a Mac, all I ever do is use tail -f to watch the Player.Log file.
     
  14. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Graham DunnettUnity Technologi
    Thanks this is seems to be very useful, I will try that out !