Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging: Improve access to log files #1123

Merged
merged 5 commits into from
Jun 16, 2024
Merged

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Jun 12, 2024

Based on discussion in #1118.

This PR does a few things:

  • Add logging for the Vortex start command, so it can more easily be copied and ran manually for troubleshooting
  • Add some SteamTinkerLaunch log paths to the "Game Files" menu:
    • Path to /dev/shm/steamtinkerlaunch/steamtinkerlaunch.log file, so that it can be opened graphically.
    • Path to /dev/shm/steamtinkerlaunch folder, which may contain other logs specific to that session.
    • Path to the SteamTinkerLaunch log directory, which is a configurable path, but defaults to ${STLCFGDIR}/logs/steamtinkerlaunch.

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:

  • Update remaining langfiles

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jun 12, 2024

@OrderedSet86 This is based off of our discussion in #1118 (comment). 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 sonic2kk force-pushed the logging-access-improvements branch from 5366ce9 to ea5ea40 Compare June 13, 2024 02:12
sonic2kk added 4 commits June 16, 2024 01:22
This makes manually copying the Vortex command easier
to troubleshoot running it manually.
* Current log at /dev/shm/steamtinkerlaunch/steamtinkerlaunch.log
* Current temp dir at /dev/shm/steamtinkerlaunch (to view other log files, not just steamtinkerlaunch.log)
* Per-game log folder at LOGDIR (by default, STLCFGDIR/logs/steamtinkerlaunch)
@sonic2kk sonic2kk force-pushed the logging-access-improvements branch from c4ff8d3 to 2f416f1 Compare June 16, 2024 00:22
@sonic2kk
Copy link
Owner Author

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 😄

@sonic2kk sonic2kk merged commit 6ac151a into master Jun 16, 2024
2 checks passed
@sonic2kk sonic2kk deleted the logging-access-improvements branch June 16, 2024 05:13
@OrderedSet86
Copy link

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
Copy link

#1127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants