Search Unity

REQUEST: show Log/Warning/Errors in Headless mode when running from Terminal

Discussion in 'Linux' started by mischa2k, Jan 15, 2016.

  1. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It would be incredibly useful to see Debug.Log/Warning/Error messages when running a headless mode executable from the Terminal. Especially when running game servers, we don't really know what's going on or if there were any errors - unless we check the log files, which works, but is really annoying in the long run.

    I also attached a screenshot that shows the current output that is shown when running a headless mode executable in the terminal. Log messages are not shown there.

    [Tested on Linux Mint 17.2 Cinnamon, with latest Unity Linux build)

    Sorry if this is the wrong forum area, but I assumed that you guys take care of the Linux build part as well.
     

    Attached Files:

    TeKniKo64 likes this.
  2. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    You can watch the log file with the tail command:

    tail -f ~/.config/unity3d/Editor.log

    This will provide new output as soon as the log file updates.
     
    superkid333 likes this.
  3. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks, that works!

    Having the output in the executable's log would still be much easier, especially when running game servers on a remote server etc.
     
    Last edited: Jan 16, 2016
  4. ultrapino

    ultrapino

    Joined:
    Dec 6, 2015
    Posts:
    2
    Hi! I have a similar problem: at that point if I close the terminal window, the server stops, how can I close it without stopping the server?

    Thank you for your time!
     
  5. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    This is just how the Linux/Unix terminal works, if you've started it using terminal, you have to keep the terminal open until the command is finished or stopped. One way to work around this might be to create a shell script to start your server and make it executable (chmod +x /path/to/shell/script.sh), then run it through your file manager. You could also create a .desktop file to run it instead. I can't currently guide you step by step (I'm on my phone), but you should be able to find all the necessary information through Google.
     
    superkid333 and ultrapino like this.
  6. ultrapino

    ultrapino

    Joined:
    Dec 6, 2015
    Posts:
    2
    Ok, thank you very much, reading your post gave me an idea and searching on Internet I found this: http://ubuntuforums.org/showthread.php?t=787417 , running the screen command and typing the following commands I am able to close the terminal.
    For now it's working.
     
    superkid333 likes this.
  7. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    This is a good point, but you can also run with -logfile /dev/stdout (optionally piping to tee Editor.log)
     
    stylophone and LukaKotar like this.
  8. superkid333

    superkid333

    Joined:
    Apr 15, 2016
    Posts:
    9

    Hey, I run Ubuntu Desktop and Ubuntu Server. I use "screen" on my server and it's amazing. I am glad you found that option. It really can work well if you prefer to use the terminal for multiple programs.
     
    ultrapino likes this.