protonscr

steam command does not produce logs if output is not a tty

steamclosed
ValveSoftware/steam-for-linux#11793 · opened 2025-03-03 by ammaraskar · updated 2025-03-03 · 2 comments · github
Aammaraskar 2025-03-03 github

Your system information

  • Distribution (e.g. Ubuntu): SteamOS

Steps for reproducing this issue:

When running the steam command and redirecting its output a file, most logs do not get outputted:

(deck@steamdeck ~)$ steam -silent 2>/tmp/steam_stderr >/tmp/steam_stdout
(deck@steamdeck ~)$ cat /tmp/steam_stderr /tmp/steam_stdout 
steam.sh[6811]: Running Steam on steamos rolling 64-bit
steam.sh[6811]: STEAM_RUNTIME is enabled automatically
setup.sh[6862]: Steam runtime environment up-to-date!

However, if we run directly in the CLI or use this trick from StackOverflow to pretend to be a tty, we get the normal set of logs as expected:

(deck@steamdeck ~)$ faketty () { script -qefc "$(printf "%q " "$@")" /dev/null; }
(deck@steamdeck ~)$ faketty steam -silent 2>/tmp/steam_stderr2 >/tmp/steam_stdout2
(deck@steamdeck ~)$ cat /tmp/steam_stderr2 /tmp/steam_stdout2
steam.sh[7855]: Running Steam on steamos rolling 64-bit
steam.sh[7855]: STEAM_RUNTIME is enabled automatically
setup.sh[7906]: Steam runtime environment up-to-date!
steam.sh[7855]: Using supervisor /home/deck/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/steam-runtime-supervisor
steam.sh[7855]: Steam client's requirements are satisfied
CProcessEnvironmentManager is ready, 6 preallocated environment variables.
[2025-03-02 18:53:06] Startup - updater built Jan 28 2025 00:50:36
[2025-03-02 18:53:06] Startup - Steam Client launched with: '/home/deck/.local/share/Steam/ubuntu12_32/steam' '-srt-logger-opened' '-steamdeck' '-silent'
[2025-03-02 18:53:06] Opted in to client beta 'steamdeck_stable' via beta file
You are in the 'steamdeck_stable' client beta.
03/02 18:53:06 minidumps folder is set to /tmp/dumps
03/02 18:53:06 Init: Installing breakpad exception handler for appid(steam)/version(1738026274)/tid(7975)
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2025-03-02 18:53:07] Loading cached metrics from disk (/home/deck/.local/share/Steam/package/steam_client_metrics.bin)
[2025-03-02 18:53:07] Using the following download hosts for Public, Realm steamglobal
...
...

I'm not sure if this is intended behavior, it seems like there is something inhibiting output for non-tty fds in steam.

The motivation for this issue is that some downstream projects like Batocera launch and then monitor the steam command's output to know when it launches games etc. It would be nice if there was a command-line flag that switches this behavior.

Kkisak-valve maintainer 2025-03-03 github

Hello @ammaraskar, Steam should be generating a console log at .local/share/Steam/logs/console-linux.txt regardless of how it's run.

Aammaraskar 2025-03-03 github

Thank you for that information!

Nothing extracted yet.