sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.03k stars 69 forks source link

Logging: Improve access to log files #1123

Closed sonic2kk closed 2 weeks ago

sonic2kk commented 3 weeks ago

Based on discussion in #1118.

This PR does a few things:

As per usual, if xdg-open is not available on the system, these files cannot be opened. If the paths don't exist in the first place when the menu is being opened, they won't be displayed on the menu (following the existing pattern).

TODO:

sonic2kk commented 3 weeks ago

@OrderedSet86 This is based off of our discussion in https://github.com/sonic2kk/steamtinkerlaunch/issues/1118#issuecomment-2161904545. Feel free to take a look, if you like.

The logging changes in Game Files were primarily made around your point here:

Yes, I appreciate this! This would be a large change but you might consider the Lutris style of logging, where a window pops during game installation / setup for logs. Since STL is a tinkering tool it could just always have a log window open. Additionally, if logs are sometimes hidden, a "logs" button would be helpful - Lutris lets you right click on the game and click "Show Logs", but for STL you could include it in the settings / mainmenu grid. It doesn't have to be fancy, just xdg-open the user's editor pointing at /dev/shm/steamtinkerlaunch/vwrun.txt. Somewhere in here perhaps: [image of Main Menu]

Logging Window

Because all SteamTinkerLaunch windows are Yad dialogs, persistent windows like you have described are not really feasible. When you click any of the buttons along the bottom row of a window, the reason it closes is because those are dialog action buttons, a row of glorified "Ok/Cancel" buttons. The Main Menu buttons spawn separate processes that spawn further Yad dialogs. Dynamic windows like the one in Lutris is also not possible, I don't think you can continually update dialog content with Yad.

In theory, there could be a button that would open a dialog with log text, but it wouldn't be possible to my knowledge to dynamically update this content with Yad, so it wouldn't do anything. On top of this, it would be tied to the Steam Game process. If it was started as, say, a separate disowned SteamTinkerLaunch process, then steamtinkerlaunch.log would contain logging for that process (we may be able to hack in a way to force-disable logging for some processes, but it would be ugly. But to begin with there would be no way to my knowledge to achieve that kind of dynamic window behaviour with Yad.

This is why I went with the xdg-open approach. Game Files already has this integration, so including the files here in this way made the most sense to me. The files here are primarily for per-game configuration as noted on the wiki, but I think having logs here as well is fine too.

Include vwrun.txt Link

The vwrun.txt log is too specific in my opinion to include, so as a compromise, I went with including a way to open /dev/shm/steamtinkerlaunch, where the log is stored. Plus, the Vortex log may not exist when this dialog is opened, which is why it is not included.

In addition to this, I also included a new log line that states where the Vortex run log (vwrun.txt) is stored, so that users can more easily find it.


I aim to strike a balance here of incorporating your suggestion, which I understand to essentially be to make the logs easier to access within the limitations here.

You don't have to test out the PR or anything, I'm pinging for awareness. I try to include users who make suggestions where possible in discussion. Normally, this would've been discussed in a dedicated issue, but to avoid further cluttering the earlier issue, I thought pinging here about this specific change made more sense.

sonic2kk commented 2 weeks ago

I think this is good to merge, please let me know if you have any comments based on what I couldn't add exactly in your original ask. Anything you want to reply to in my above message is still welcome :smile:

OrderedSet86 commented 2 weeks ago

Thanks, I really appreciate these changes! I also will be putting in a PR to update the README shortly. Hopefully that will lead to less confusion over using the correct version.

OrderedSet86 commented 2 weeks ago

https://github.com/sonic2kk/steamtinkerlaunch/pull/1127