Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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.