Jump to content

[1.8+] KSPBugReport : Easy bug reporting plugin


Recommended Posts

KSPBugReport

Bug reporting plugin for KSP players

This small plugin adds a "bug report" menu to the KSP debug menu (opened with ALT+F12).

That menu provide a way for players to create a zipped bug report containing the KSP logs and game database dumps usually needed by mod authors when they need to troubleshot bugs and issues.

It also include an option to automatically upload the bug report to an online file sharing service.

screenshot

Dowload and installation

Compatible with KSP 1.8+

KSPBugReport is available on CKAN (recommended)

For manual installation :

  • Go to the GitHub release page and download the file named KSPBugReport_x.x.x_KSP1.8+.zip
  • Open the downloaded *.zip archive
  • Copy the KSPBugReport folder found in the archive into the GameData folder of your KSP installation.

How to use

  • Try to reproduce your issue or bug, in order for KSP to log information about what happened.
  • Press ALT+F12
  • In the Bug Report section, click on Create report. This will create a zip archive on your desktop. You can open the location of that zip file in your file explorer by clicking on Open report folder.
  • If you want to add screenshots to your report, open/position what you want to show and click on Add screenshot to last report. The debug menu window won't appear on the screenshot. You can add multiple screenshots.
  • To upload the report to a file sharing service, click on Upload last report. Once uploaded, the download link to your report will be copied to the clipboard and you can paste it elsewhere (forum post, github, discord...). In case you loose the copied link, you can copy it to the clipboard again by clicking on Copy last upload link to clipboard.

Disclaimer

This plugin will upload information about your computer specs, your KSP install and your current game on the internet, on public file sharing services.

The KSP logs usually don't contain any sensitive information, however, be aware that :

  • The KSP.log file contain the path to your KSP install, which can contain the user name for your computer (for example C:\Users\MyUserName\...\KSP\). This is usually not a security issue, but if you want to avoid that, move your KSP folder to another path (for example C:\Games\KSP\).
  • The KSP.log file contain everything that is logged by your mods/plugins. An ill-intentioned mod author can potentially access any file on your computer and dump sensitive information in the KSP logs.
  • Your savegame is included in the report, with everything that you can write and save in KSP (vessel names and descriptions for example)

Notes :

  • Bug reports will contain :
    • The KSP.log file
    • The modulemanager.configcache file, or if not found a Configs.txt file generated from the live game database
    • A *.sfs savegame generated from the currently loaded game (if any)
    • The Logs\Kopernicus body configs dumps (if present)
  • Available upload services :
    • Primary : https://oshi.at (90 days retention, unlimited downloads)
    • Secondary : https://0x0.st (30 days minimum retention, max 1 year depending on file size, unlimited downloads)
    • Tertiary : https://file.io (14 days retention, file deleted after the first download)
  • Zip compression is done through the System.IO.Compression mono library as provided in the Unity 2019.2.2f1 editor download in Editor\Data\MonoBleedingEdge\lib\mono\4.5

License

MIT

Edited by Gotmachine
Link to post
Share on other sites

Great idea!!!
 

A number of mods, including ModuleManager and my newer mods, add logs t9 the Logs directory,  wh6 not include everything from that directory instead of just Kopernicus?

Also, the Player.log is also needed, I find it more useful than the KSP.log

Edited by linuxgurugamer
Link to post
Share on other sites
Posted (edited)
2 hours ago, linuxgurugamer said:

A number of mods, including ModuleManager and my newer mods, add logs t9 the Logs directory,  wh6 not include everything from that directory instead of just Kopernicus?

Because contrary to KSP.log, that folder is never cleared, so it can (and will) become huge and full of irrelevant logs from mods that might not even be installed anymore.
Also, Kopernicus has the bad taste to dump a ton of stuff in there (including a copy of the KSP.log and modulemanager.configcache, etc) and also generate a zip containing those in there, that's why I only get the body configs dumps from Logs\Kopernicus, not the whole folder.
I really don't understand why modders feel the need to do some separate logging. I find it counterproductive, as it is critical IMO to be able to replace a log entry in the execution flow of everything else.

2 hours ago, linuxgurugamer said:

Also, the Player.log is also needed, I find it more useful than the KSP.log

KSP.log has the timestamps, the [ERR, [EXC, [WRN prefixes, is much more readable and has the stacktraces on errors/exceptions.
Does a stacktrace on a random log entry really help debug anything ? If you need a stacktrace for your debugging needs, I personally use the following helper method  :

[Conditional("DEBUG")]
public static void LogDebugStack(string message)
{
	System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace();
	UnityEngine.Debug.Log(message + "\n" + stackTrace.ToString());
}

Anyway, the issue is that player.log is often huge (100mb+ compressed player.log aren't that uncommon), which is a problem for being able to share those reports.

Edited by Gotmachine
Link to post
Share on other sites
1 hour ago, Gotmachine said:

KSP.log has the timestamps, the [ERR, [EXC, [WRN prefixes, is much more readable and has the stacktraces on errors/exceptions.
Does a stacktrace on a random log entry really help debug anything ? If you need a stacktrace for your debugging needs, I personally use the following helper method  :

Yes.

KSP.log is the.. .KSP's log. :)

The Player.log is where Unity does its logging. Crashes and other inner problems are only logged on the Player.log.

Granted, it's not needed every time. Perhaps as an option?

Link to post
Share on other sites
4 minutes ago, Lisias said:

Crashes and other inner problems are only logged on the Player.log.

That plugin is useless in the case of a hard crash, anyway.
And I have serious doubts that there is a single extra line in Player.log vs KSP.log.
KSP.log is just an extra callback for the default Unity log handler.
The only extra stuff in Player.log are the stacktraces, which are discarded for the "Log", "Assert" and "Warning" logging levels in KSP.log (but not for the "Error" and "Exception" levels).

Link to post
Share on other sites
Just now, Gotmachine said:

That plugin is useless in the case of a hard crash, anyway.

Point taken...

1 minute ago, Gotmachine said:

And I have serious doubts that there is a single extra line in Player.log vs KSP.log.
KSP.log is just an extra callback for the default Unity log handler.

That it's used only by KSP. Unity still uses the original handler - so any problems inside Unity are only logged on the Player.log .

But your argument that crashes renders your plugin useless is right - anything really needing the Player.log would be better handled externally, as on CKAN perhaps.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...