Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Debug logging from C# in DotNet?

Discussion in 'Project Tiny' started by mivey_unity, Jul 9, 2019.

  1. mivey_unity

    mivey_unity

    Joined:
    Jun 18, 2019
    Posts:
    4
    How do I print debug log messages from C# in DotNet build mode?

    This compiles but I don't see anything in Unity's console tab (it works in wasm mode, but I want it to work in DotNet mode):
    Code (CSharp):
    1. using UnityEngine;
    2. Debug.Log("asdf");
    Same with this:
    Code (CSharp):
    1. using System;
    2. Console.WriteLine("asdf");
    This doesn't even compile even though it is copied from the docs:
    Code (CSharp):
    1. using Unity.Tiny.Debugging;
    2. Debug.LogFormat("asdf");
    The compiler says:
    Assets/Ships/Scripts/ShipMovementSystem.cs(8,18): error CS0234: The type or namespace name 'Debugging' does not exist in the namespace 'Unity.Tiny' (are you missing an assembly reference?)


    Does anyone else have logging working?
     
  2. abivos

    abivos

    Joined:
    Sep 15, 2018
    Posts:
    9
    Is there a way for logging? Preferably universal for windows and web builds?
     
  3. TwoorbJan

    TwoorbJan

    Joined:
    Mar 6, 2013
    Posts:
    38
    Code (CSharp):
    1. Unity.Tiny.Debug.Log("Test");
    Doesn't that work? (or using Unity.Tiny and just Debug.Log) I haven't been using it in forever since I only build for web and I made a plugin so I get the colors for error and warning in the browser console.
     
    abivos likes this.
  4. abivos

    abivos

    Joined:
    Sep 15, 2018
    Posts:
    9
    I tried Unity.Tiny.Debug.Log in windows build before, but didn't find my messages in editor console, build folder, usual AppData\LocalLow, or even in console that you can see if you run your game with Unity.Runtime.EntryPoint.exe.
    Will investigate it later, when I feel the need to do a little "debuigging" with logs.
     
  5. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    Unity.Tiny.Debug.Log works fine as long as you are running a Debug build.
     
    abivos likes this.
  6. djsell

    djsell

    Joined:
    Aug 29, 2013
    Posts:
    77
    Fortunately 0.33 is supposed to have a lot of debugging and logging improvements. Kappa
     
  7. TwoorbJan

    TwoorbJan

    Joined:
    Mar 6, 2013
    Posts:
    38
    I really hope so, I had to make my own entity debugger for web builds so I could see what was going on. Fingers crossed that work has continued on Tiny so we get a large update whenever new versions are possible.
     
    GilCat likes this.